From 18b20f5cab22b5377b15f352d0865c48f003864e Mon Sep 17 00:00:00 2001 From: Michael O'Keefe Date: Thu, 14 Nov 2024 14:07:59 -0700 Subject: [PATCH] Add example build-and-test CI workflow --- .github/workflows/build_and_test.yaml | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build_and_test.yaml diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml new file mode 100644 index 00000000..8e29a283 --- /dev/null +++ b/.github/workflows/build_and_test.yaml @@ -0,0 +1,41 @@ +name: Build and Test + +on: + push: + branches: [fastsim-3] + pull_request: + workflow_dispatch: + +jobs: + build-and-test: + name: build ${{ matrix.python-version }} on ${{ matrix.platform || matrix.os }} + strategy: + fail-fast: true + matrix: + os: + - ubuntu + - macos + - windows + python-version: + - "3.8" + - "3.9" + - "3.10" + runs-on: ${{ format(`{0}-latest`, matrix.os) }} + steps: + - uses: actions/checkout@v4 + - name: set up rust + uses: dtolnay/rust-toolchain@stable + - run: rustup target add aarch64-apple-darwin + if: matrix.os == 'macos' + - name: set up python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: install python dependencies + run: python -m pip install --upgrade pip setuptools wheel pytest + - name: run cargo tests + run: cargo test + - name: install FASTSim python + run: pip install -e . + - name: run pytest + run: pytest -v