From 9ce3aa46f84912788c7b2d2a3a4cb86f58f9c787 Mon Sep 17 00:00:00 2001 From: Christian Oertlin Date: Mon, 8 Apr 2024 16:26:03 +0200 Subject: [PATCH] add testa and coverage --- .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..131b8ff --- /dev/null +++ b/.github/workflows/tests_coverage.yaml @@ -0,0 +1,53 @@ +name: CG CI + +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 -n auto --cov=cg/ + coveralls + 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