From 37a8bb8822393314e2b5fedf28707fd7e41d3d45 Mon Sep 17 00:00:00 2001 From: merlos <404446+merlos@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:41:18 +0300 Subject: [PATCH] add action to run tests --- .../workflows/primero-api-run-tests-main.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/primero-api-run-tests-main.yml diff --git a/.github/workflows/primero-api-run-tests-main.yml b/.github/workflows/primero-api-run-tests-main.yml new file mode 100644 index 0000000..96ad815 --- /dev/null +++ b/.github/workflows/primero-api-run-tests-main.yml @@ -0,0 +1,39 @@ +name: primero-api unit-tests [main] + +# +# runs unit tests if there is a change in the primero-api folder +# and the branch is main +# + +on: + push: + branches: + - main # Replace with your branch name + paths: + - 'primero-api/**' # Replace with the path to your folder + +permissions: + contents: read + +jobs: + run-test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + + - name: Install package with dev for running tests + run: | + cd primero-api + pip install -e ".[dev]" + + - name: Run unit-tests + run: | + cd primero-api + pytest tests + \ No newline at end of file