From 7d1af11cf93fa8132210386b5276a07d911532cf Mon Sep 17 00:00:00 2001 From: ChristianOertlin Date: Tue, 9 Apr 2024 12:30:54 +0200 Subject: [PATCH] add(tests and coverage workflow) (#130) (patch) add test coverage workflow --- .github/workflows/tests_coverage.yaml | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/tests_coverage.yaml diff --git a/.github/workflows/tests_coverage.yaml b/.github/workflows/tests_coverage.yaml new file mode 100644 index 0000000..c57965d --- /dev/null +++ b/.github/workflows/tests_coverage.yaml @@ -0,0 +1,53 @@ +name: Tests and Coverage + +on: + pull_request: + push: + branches: + - master + +jobs: + tests-coverage: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.1 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: false + + - name: Cache dependencies + uses: actions/cache@v3 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: poetry install --no-interaction + + - name: Test with pytest & Coveralls + run: | + pytest --cov=genotype-api/ + coveralls --service=github + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + + finish: + needs: tests-coverage + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2.2.3 + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true \ No newline at end of file