From da65f3ce35658756a1c2eb3230476195fe4119db Mon Sep 17 00:00:00 2001 From: Kevin Fronczak Date: Fri, 7 Jun 2024 14:29:09 -0400 Subject: [PATCH] Merge tests and coverage workflows --- .github/workflows/tests.yml | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d424c132..453e80a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: build +name: tests on: push: @@ -7,7 +7,7 @@ on: branches: [ master, dev ] jobs: - build: + pytest: runs-on: ${{ matrix.platform }} strategy: max-parallel: 4 @@ -17,7 +17,8 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - name: Check out code from GitHub + uses: actions/checkout@v4.1.6 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -31,3 +32,32 @@ jobs: - name: Tests run: | tox -r + - name: Upload coverage + uses: actions/upload-artifact$v4.3.3 + with: + name: coverage-${{ matrix.python-version }}-${{ matrix.platform }} + path: coverage.xml + overwrite: true + coverage: + runs-on: ${{ matrix.platform }} + matrix: + platform: + - ubuntu-latest + python-version: ['3.11'] + needs: + - pytest + timeout-minutes: 10 + steps: + - name: Check out code from GitHub + uses: actions/checkout@v4.1.6 + - name: Download all coverage artifacts + uses: actions/download-artifact@v4.1.7 + with: + path: coverage-${{ matrix.python-version }}-${{ matrix.platform }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4.4.1 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + name: blinkpy +