From 4873d9630b12b5f6df06049afed1a8b8aa075357 Mon Sep 17 00:00:00 2001 From: Alex Petty Date: Sat, 9 Mar 2024 22:56:57 -0600 Subject: [PATCH 1/2] Create test.yml Create a github action to run unit tests on every push / pr --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 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..d272716 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +# 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 + +name: Build and test + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./app + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.12 + uses: actions/setup-python@v3 + with: + python-version: "3.12" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install . + pip install sqlalchemy # for tests + - name: Test with pytest + run: python -m unittest From d17af6a0bdc15d2b3ffdc9f236df85dbf0e875b2 Mon Sep 17 00:00:00 2001 From: Alex Petty Date: Sat, 9 Mar 2024 22:58:49 -0600 Subject: [PATCH 2/2] Working dir should be called software --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d272716..f9bb555 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./app + working-directory: ./software steps: - uses: actions/checkout@v3 - name: Set up Python 3.12