Skip to content

Commit

Permalink
for testing, squash later
Browse files Browse the repository at this point in the history
  • Loading branch information
iwtba4188 committed Dec 8, 2023
1 parent 466c6ca commit 204ae86
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/smokeshow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Generate Coverage

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

jobs:
Smokeshow:
if: ${{ github.event == 'push' && github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: pip install smokeshow

- uses: dawidd6/[email protected]
with:
workflow: test.yml
commit: ${{ github.event.workflow_run.head_sha }}

- run: smokeshow upload coverage
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 85
SMOKESHOW_GITHUB_CONTEXT: Coverage
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 6 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ jobs:
pip install -r requirements.txt
pip install -r requirements-tests.txt
- name: Test
run: python -m pytest -n auto tests --cov=. --cov-report=html:coverage --cov-fail-under=80
- run: smokeshow upload coverage
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 50
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: python -m pytest -n auto tests --cov=. --cov-report=html:coverage --cov-fail-under=85
- name: Store coverage files
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
3 changes: 1 addition & 2 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
pytest==7.4.3
pytest-xdist==3.4.0
pytest-cov==4.1.0
httpx==0.25.1
smokeshow==0.4.0
httpx==0.25.1

0 comments on commit 204ae86

Please sign in to comment.