Skip to content

Commit

Permalink
Store coverage as a test.yml artifact, add smokeshow.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bswck committed Oct 29, 2023
1 parent 7165a02 commit 2c3891c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/smokeshow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Smokeshow

on:
workflow_run:
workflows: [Tests]
types: [completed]

permissions:
statuses: write

jobs:
smokeshow:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment: smokeshow
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- run: pip install smokeshow
- uses: dawidd6/action-download-artifact@v2
with:
workflow: test.yml
commit: ${{ github.event.workflow_run.head_sha }}
- run: smokeshow upload coverage-html
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
# 5 is set here while V2 is in development and coverage is far from complete
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 91
SMOKESHOW_GITHUB_CONTEXT: coverage
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}
17 changes: 6 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ on: [push]
jobs:
test:
environment: test
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: CLI Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 50
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -31,9 +26,9 @@ jobs:
- name: Report coverage
run: |
coverage report
coverage html
- name: Install smokeshow and upload coverage
if: ${{ matrix.python-minor-version == 8 }}
run: |
pip install smokeshow
smokeshow upload htmlcov/index.html
coverage html --show-contexts --title "runtime_generics coverage for ${{ github.sha }}"
- name: Store coverage html
uses: actions/upload-artifact@v3
with:
name: coverage-html
path: htmlcov

0 comments on commit 2c3891c

Please sign in to comment.