Fix a nasty race condition. #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Cross-platform tests | |
# Do this on every push that isn't tagged | |
on: | |
push: | |
tags-ignore: | |
- '**' | |
branches: | |
- '**' | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
DEBIAN_FRONTEND: noninteractive | |
MWA_BEAM_FILE: mwa_full_embedded_element_pattern.h5 | |
jobs: | |
test: | |
name: Test ${{matrix.os}} - Rust ${{matrix.rust}} | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macos-latest] | |
rust: [nightly, beta, stable, 1.64.0] # MSRV | |
include: | |
- os: macos-latest | |
python-version: [3.7, 3.8, 3.9, 3.10, 3.11] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Dependencies | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt -y update | |
sudo apt -y install libhdf5-dev gcc pkg-config python3 curl wget git jq | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
brew install pkg-config | |
# 1.12 doesn't work? | |
brew install hdf5@1.10 | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{matrix.rust}} | |
profile: minimal | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo check, fmt, clippy | |
run: | | |
cargo check --all | |
cargo fmt --all -- --check | |
cargo clippy --all -- -D warnings | |
- name: No GPU references in CPU-only header | |
run: | | |
! grep -i gpu include/mwa_hyperbeam.h | |
- name: Get the HDF5 file | |
run: curl http://ws.mwatelescope.org/static/mwa_full_embedded_element_pattern.h5 -o mwa_full_embedded_element_pattern.h5 | |
# Taken from https://github.com/dtolnay/thiserror/blob/a2d1ed1ccfc2a5dbb2a8fb45d4f938175a28bc86/.github/workflows/ci.yml | |
- name: Enable type layout randomization | |
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV | |
if: matrix.rust == 'nightly' | |
- name: Run tests | |
run: cargo test --lib --bins | |
- name: CUDA tests | |
if: runner.os == 'Linux' | |
run: | | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb | |
sudo dpkg -i cuda-keyring_1.0-1_all.deb | |
sudo apt -y update | |
sudo apt -y install cuda --no-install-recommends | |
PATH+=:/usr/local/cuda/bin | |
# Can't run the tests; there's no GPU | |
cargo test --all --no-run --features=cuda | |
cargo test --all --no-run --features=cuda,gpu-single | |
cargo test --all --no-run --features=python,cuda | |
cargo test --all --no-run --features=python,cuda,gpu-single |