From e377ee50ad2454276dfce04c46290c9991a7a753 Mon Sep 17 00:00:00 2001 From: Mel <97147377+MelissaAutumn@users.noreply.github.com> Date: Mon, 11 Dec 2023 07:46:44 -0800 Subject: [PATCH] Run backend tests as a github action (#209) * Initial backend tests script * Only run tests if we're a pull request to main, or a push on main --- .github/workflows/backend-tests.yml | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/backend-tests.yml diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml new file mode 100644 index 000000000..d827cedb0 --- /dev/null +++ b/.github/workflows/backend-tests.yml @@ -0,0 +1,32 @@ +# This workflow will install backend's requirements and run tests + +name: Run Backend Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + pytest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install dependencies + run: | + cd ./backend + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install -r requirements-test.txt + - name: Test with pytest + run: | + cd ./backend/test && python -m pytest