From b193734abac6c1cc4548d1e28ab73acc9c43a521 Mon Sep 17 00:00:00 2001 From: Cameron Mattson <92554334+MattsonCam@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:46:20 +0000 Subject: [PATCH 1/2] Setup github actions for testing This is the basic setup of github actions to run pytest whenever merging, or on pull_request. --- .github/workflows/python-app.yml | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..7ca2c12 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,44 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +# This workflow will install Python dependencies using Poetry and run tests with pytest on all supported Python versions + +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ["3.10", "3.11"] + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + export PATH="$HOME/.local/bin:$PATH" + + - name: Install dependencies with Poetry + run: | + poetry install --no-interaction + + - name: Test with pytest + run: | + poetry run pytest From e1874ec9dcff30e3279d46eb5040e6f563448802 Mon Sep 17 00:00:00 2001 From: Cameron Mattson Date: Wed, 20 Nov 2024 14:29:32 -0700 Subject: [PATCH 2/2] Updated github actions workflow using pr comments. --- .github/workflows/python-app.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 7ca2c12..e4452b5 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,9 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -# This workflow will install Python dependencies using Poetry and run tests with pytest on all supported Python versions - -name: Python application +name: Test Pairwise Compare on: push: @@ -11,28 +6,28 @@ on: pull_request: branches: [ "main" ] -permissions: - contents: read - jobs: - build: + run-tests: runs-on: ubuntu-latest + strategy: matrix: python-version: ["3.10", "3.11"] + + steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Poetry run: | - curl -sSL https://install.python-poetry.org | python3 - + python -m pip install --user poetry export PATH="$HOME/.local/bin:$PATH" - name: Install dependencies with Poetry