From f7eaf1f86a8720a04623ddcd7ae88b5e3733a260 Mon Sep 17 00:00:00 2001 From: Adam Taranto Date: Sat, 28 Sep 2024 15:33:03 +1000 Subject: [PATCH 1/3] Init Pytest action --- .github/workflows/pytest.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..87b6fba --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,31 @@ +name: Python Tests + +on: [pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [3.10, 3.11, 3.12] # Test with Python 3.10 to the latest available version + + steps: + # Checkout the latest commit associated with the PR + - uses: actions/checkout@v4 + + # Set up Python based on the matrix version + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + # Install dependencies, including test dependencies from pyproject.toml + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install '.[test]' # Install all dependencies, including test-specific ones + + # Run pytest on the specified directory + - name: Run tests + run: pytest src/python/tests From 73d424cd47d4a47f1a8e89fcdf85f0cdb55233a4 Mon Sep 17 00:00:00 2001 From: Adam Taranto Date: Sat, 28 Sep 2024 15:40:16 +1000 Subject: [PATCH 2/3] debug version id --- .github/workflows/pytest.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 87b6fba..47a24ab 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -13,6 +13,9 @@ jobs: steps: # Checkout the latest commit associated with the PR - uses: actions/checkout@v4 + + - name: Debug matrix value + run: echo "Python version is ${{ matrix.python-version }}" # Set up Python based on the matrix version - name: Set up Python From 6dd518106f57f11d80e3b7d46e31ceb122cf62b7 Mon Sep 17 00:00:00 2001 From: Adam Taranto Date: Sat, 28 Sep 2024 15:48:21 +1000 Subject: [PATCH 3/3] Quotes on version numbers --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 47a24ab..04f2e47 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - python-version: [3.10, 3.11, 3.12] # Test with Python 3.10 to the latest available version + python-version: ["3.10", "3.11", "3.12"] # Test with Python 3.10 to the latest available version steps: # Checkout the latest commit associated with the PR