From 24eade063db51d22951751896e04d3388d3a369d Mon Sep 17 00:00:00 2001 From: Mawoka Date: Sat, 9 Apr 2022 11:24:42 +0200 Subject: [PATCH] :construction_worker: Testing pytest-workflow --- .github/workflows/pytest.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 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..821e94f --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,43 @@ +# .github/workflows/app.yaml +name: PyTest +on: + push: + paths: + - "classquiz/tests/**" + - "classquiz/kahoot_importer/**" + - "classquiz/storage/**" + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Install pipenv + run: pipx install pipenv + + # Setup Python (faster than using Python container) + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + cache: 'pipenv' + - run: pipenv install + - name: Prepare test environment + continue-on-error: true + run: | + pipenv run coverage run -m pytest --asyncio-mode=strict classquiz/tests + pipenv run coverage xml + - name: Report results to DeepSource + run: | + # Install deepsource CLI + curl https://deepsource.io/cli | sh + + # From the root directory, run the report coverage command + ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml + + env: + DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}