-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bec9b6d
commit ad7540e
Showing
2 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
name: Study lyte Coverage Badge | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
covergae: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest coverage genbadge[coverage] | ||
python setup.py install | ||
- name: Run coverage | ||
run: | | ||
coverage run --source study_lyte -m pytest | ||
coverage xml | ||
- name: Checkout gh-pages | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: gh-pages | ||
|
||
- name: Create Badges | ||
shell: bash | ||
run: | | ||
mkdir -p badges | ||
genbadge coverage -i coverage.xml -o badges/coverage.svg | ||
- name: Deploy Badges | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: "Update badges [skip ci]" | ||
skip_fetch: true | ||
skip_checkout: true | ||
|
||
# Without this, will get Error: | ||
# Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/coverage-badge-action/coverage-badge-action/action.yml'. | ||
# Did you forget to run actions/checkout before running your local action? | ||
- name: Checkout Back | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters