From 16dabe2326ee8a4cbe273f84c0aaf533ff24cd91 Mon Sep 17 00:00:00 2001 From: Bruce Merry Date: Wed, 20 Mar 2024 15:55:49 +0200 Subject: [PATCH] Add a Github actions workflow --- .github/workflows/test.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a04114a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: Unit tests +on: [push, pull_request] +concurrency: + group: test-${{ github.ref }} + cancel-in-progress: true +env: + CARGO_TEST_COLOR: always +jobs: + pre-commit: + on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.8' + cache: 'pip' + - name: Run pre-commit checks + run: pre-commit run --all-files + rust-tests: + strategy: + fail-fast: false + matrix: + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - name: Run Rust tests + run: cargo test + python-tests: + strategy: + fail-fast: false + matrix: + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: pip install -r requirements.txt + - name: Install package + run: pip install . + - name: Run Python tests + run: pytest