diff --git a/.github/workflows/coverage-build.yml b/.github/workflows/coverage-build.yml new file mode 100644 index 0000000..8073b2f --- /dev/null +++ b/.github/workflows/coverage-build.yml @@ -0,0 +1,35 @@ +name: Build Coverage + +on: + pull_request: + branches: + - master + +jobs: + coverage-build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: netkan + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: pip + cache-dependency-path: netkan/setup.py + - name: Install test dependencies + run: pip install .[test] + - name: force our git config + run: cp .gitconfig ~/. + - name: Run Coverage + run: | + coverage run -m pytest + coverage xml + - name: Upload Coverage + uses: actions/upload-artifact@v4 + with: + name: coverage.xml + path: netkan/coverage.xml + retention-days: 1 diff --git a/.github/workflows/coverage-report.yml b/.github/workflows/coverage-report.yml new file mode 100644 index 0000000..6dc7791 --- /dev/null +++ b/.github/workflows/coverage-report.yml @@ -0,0 +1,29 @@ +name: Report Coverage + +on: + workflow_run: + workflows: + - Build Coverage + types: + - completed + +permissions: + actions: read + contents: read + pull-requests: write + +jobs: + coverage-report: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - uses: actions/download-artifact@v4 + with: + name: coverage.xml + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Get Cover + uses: techman83/coverage@feat/workflow_run + with: + coverageFile: coverage.xml + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index f6dd7dd..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Coverage - -on: - - pull_request - -permissions: - pull-requests: write - -jobs: - coverage: - if: false - runs-on: ubuntu-latest - defaults: - run: - working-directory: netkan - steps: - - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.11 - - name: Install test dependencies - run: pip install .[test] - - name: force our git config - run: cp .gitconfig ~/. - - name: Run Coverage - run: coverage run -m pytest - - name: Generate report - run: coverage xml - - name: Get Cover - uses: orgoro/coverage@v3 - with: - coverageFile: netkan/coverage.xml - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 30f3b72..ce3ea24 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -63,9 +63,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.11 + cache: pip + cache-dependency-path: netkan/setup.py - name: Install Dependencies run: | pip install netkan/. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 122d6ed..e5c9f45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,9 +10,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.11 + cache: pip + cache-dependency-path: netkan/setup.py - name: Install test dependencies working-directory: netkan run: pip install .[test]