Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 28 additions & 23 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
release:
release:
types:
- published

Expand All @@ -19,26 +19,37 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-15-intel]
python-version: ['3.10', '3.11', '3.12', '3.13']
include:
- os: ubuntu-latest
python-version: '3.9'

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tempo2 on mac
if: runner.os == 'macOS'
run: |
brew unlink gcc && brew link gcc
brew install automake libtool
brew install automake libtool gcc
sudo ln -sf "$(brew --prefix gcc)/bin/gfortran-$(brew list --versions gcc | awk '{print $2}' | cut -d. -f1)" /usr/local/bin/gfortran
gfortran --version
./install_tempo2.sh
echo "TEMPO2_PREFIX=$HOME/.local" >> "$GITHUB_ENV"
echo "--- tempo2 install verification ---"
ls -la "$HOME/.local/include/" || echo "WARNING: $HOME/.local/include/ does not exist"
ls -la "$HOME/.local/lib/" || echo "WARNING: $HOME/.local/lib/ does not exist"
test -f "$HOME/.local/include/tempo2.h" || { echo "FATAL: tempo2.h not found at $HOME/.local/include/tempo2.h"; exit 1; }
- name: Install tempo2 on linux
if: runner.os == 'Linux'
run: |
./install_tempo2.sh
echo "TEMPO2_PREFIX=$HOME/.local" >> "$GITHUB_ENV"
test -f "$HOME/.local/include/tempo2.h" || { echo "FATAL: tempo2.h not found at $HOME/.local/include/tempo2.h"; exit 1; }
- name: Install dependencies and package
run: |
python -m pip install --upgrade pip
Expand All @@ -55,29 +66,23 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install tempo2 on mac
if: runner.os == 'macOS'
run: |
brew unlink gcc && brew link gcc
brew install automake
./install_tempo2.sh
- name: Install tempo2 on linux
if: runner.os == 'Linux'
python-version: '3.12'
- name: Install tempo2
run: |
./install_tempo2.sh
echo "TEMPO2_PREFIX=$HOME/.local" >> "$GITHUB_ENV"
- name: Build
run: |
python -m pip install --upgrade pip setuptools wheel build
python -m build --sdist --outdir dist
make dist
- name: Test the sdist
run: |
mkdir tmp
mkdir tmp
cd tmp
python -m venv venv-sdist
venv-sdist/bin/python -m pip install --upgrade pip setuptools
Expand All @@ -94,17 +99,17 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Download wheel/dist from build
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4
with:
name: dist
path: dist
Expand Down
15 changes: 9 additions & 6 deletions install_tempo2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ tar zxvf 2021.07.1-correct.tar.gz
cd psrsoft-tempo2-*

# remove LT_LIB_DLLOAD from configure.ac
sed_in_place="-i ''" # For macOS
if [[ "$(uname -s)" == "Linux" ]]; then
sed_in_place="-i" # For Linux
if [[ "$(uname -s)" == "Darwin" ]]; then
sed -i '' "s/LT_LIB_DLLOAD//g" "configure.ac"
else
sed -i "s/LT_LIB_DLLOAD//g" "configure.ac"
fi
sed "$sed_in_place" "s/LT_LIB_DLLOAD//g" "configure.ac"

./bootstrap
./configure --prefix=$prefix
make && make install
# Prevent autoconf from enabling C23 (where bool is a keyword),
# which breaks tempo2's jpleph.c `typedef int bool;`
./configure --prefix=$prefix ac_cv_prog_cc_c23=no
make
make install
cp -r T2runtime/* $TEMPO2
cd ..

Expand Down
Loading