Skip to content

Commit

Permalink
Upgraded test CIs to also test on MacOS 14 Arm64 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
gsleap committed Apr 12, 2024
1 parent 64f5fcf commit 9dc203c
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 35 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,22 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive

- name: Install cfitsio
run: ./.github/workflows/make_cfitsio.sh
shell: bash
- name: install cfitsio
env:
# TODO: CFITSIO_VERSION: 4.4.0
CFITSIO_VERSION: 3.49
run: |
cd /tmp
curl "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-${CFITSIO_VERSION}.tar.gz" -o cfitsio.tar.gz
tar -xf cfitsio.tar.gz
rm cfitsio.tar.gz
cd cfitsio-${CFITSIO_VERSION}
./configure --prefix=/usr/local --enable-reentrant --disable-curl
sudo make shared
sudo make install
cd ..
sudo ldconfig
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -49,10 +62,10 @@ jobs:
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"

- name: Generate test lcov coverage into coverage/ dir
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- name: install maturin
run: |
python -m pip install --upgrade pip
python -m pip install maturin # [patchelf] ?
python -m pip install maturin
- name: build mwalib
run: |
Expand Down
53 changes: 35 additions & 18 deletions .github/workflows/run_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,43 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, macOS-14]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cfitsio
run: ./.github/workflows/make_cfitsio.sh
shell: bash
uses: actions/checkout@v4

- name: (macos) install automake and autoconf
if: ${{ startsWith(matrix.os, 'macOS') }}
run: |
brew install automake autoconf
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: install cfitsio
env:
# TODO: CFITSIO_VERSION: 4.4.0
CFITSIO_VERSION: 3.49
run: |
cd /tmp
curl "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-${CFITSIO_VERSION}.tar.gz" -o cfitsio.tar.gz
tar -xf cfitsio.tar.gz
rm cfitsio.tar.gz
cd cfitsio-${CFITSIO_VERSION}
./configure --prefix=/usr/local --enable-reentrant --disable-curl
sudo make shared
sudo make install
cd ..
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo ldconfig
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -44,18 +64,15 @@ jobs:
- name: Run rust tests to generate test data
run: cargo test --features=cfitsio-static

- name: Run pytests
- name: Setup python environment and run pytests
run: |
pip3 install --upgrade pip
python3 -m venv env
source env/bin/activate
pip3 install maturin==1.3.2
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install automake
fi
pip3 install --upgrade pip
python3 -m venv env
source env/bin/activate
pip3 install --upgrade pip
pip3 install maturin==1.3.2
maturin develop --features=python,cfitsio-static --strip
maturin develop --features=python,cfitsio-static --strip
pip install pytest
pytest
pip3 install pytest
pytest
39 changes: 29 additions & 10 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,47 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, macOS-14]
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install cfitsio
run: ./.github/workflows/make_cfitsio.sh
shell: bash
- name: (macos) install automake and autoconf
if: ${{ startsWith(matrix.os, 'macOS') }}
run: |
brew install automake autoconf
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: install cfitsio
env:
# TODO: CFITSIO_VERSION: 4.4.0
CFITSIO_VERSION: 3.49
run: |
cd /tmp
curl "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-${CFITSIO_VERSION}.tar.gz" -o cfitsio.tar.gz
tar -xf cfitsio.tar.gz
rm cfitsio.tar.gz
cd cfitsio-${CFITSIO_VERSION}
./configure --prefix=/usr/local --enable-reentrant --disable-curl
sudo make shared
sudo make install
cd ..
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo ldconfig
fi
- name: Run tests
- name: Run tests on latest stable rust
run: cargo test --release --features cfitsio-static,examples

- name: Minimum-specified Rust version works
run: |
MIN_RUST=$(grep -m1 "rust-version" Cargo.toml | sed 's|.*\"\(.*\)\"|\1|')
~/.cargo/bin/rustup install $MIN_RUST --profile minimal
cargo +${MIN_RUST} test
cargo +${MIN_RUST} test --features cfitsio-static,examples
MIN_RUST=$(grep -m1 "rust-version" Cargo.toml | sed 's|.*\"\(.*\)\"|\1|')
~/.cargo/bin/rustup install $MIN_RUST --profile minimal
cargo +${MIN_RUST} test --features cfitsio-static,examples
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Changes in each release are listed below.
## 1.3.0 12-Apr-2024

* Added 'EDA2' and 'SHAO' as new valid `ReceiverType`s to `Rfinput` struct.
* Release now include MacOS Arm architecture binaries.
* Release and tests now include MacOS 14 Arm64 architecture binaries.

## 1.2.3 12-Mar-2024

Expand Down

0 comments on commit 9dc203c

Please sign in to comment.