From fdbf0e065990be99ba79dbf532433e5661144af9 Mon Sep 17 00:00:00 2001 From: Simon Beal Date: Mon, 23 Oct 2023 10:47:10 +0100 Subject: [PATCH] Add Python tests --- .github/workflows/tests.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 112afa5f..e3368d55 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,6 +8,7 @@ on: merge_group: types: [ "checks_requested" ] + env: RUST_BACKTRACE: 1 CARGO_TERM_COLOR: always @@ -17,6 +18,11 @@ jobs: test: name: Tests runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + python-version: ["3.8"] + steps: - name: Checkout code @@ -45,3 +51,20 @@ jobs: run: cargo test --no-default-features --no-run - name: Run Rust tests run: cargo test --no-default-features + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[test]" + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 main --count --select=E9,F63,F7,F82 --show-source --statistics + - name: Test with pytest + run: | + pytest python/tst/unit