-
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
3cbaef0
commit 154a010
Showing
1 changed file
with
17 additions
and
28 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 |
---|---|---|
|
@@ -11,46 +11,35 @@ on: | |
jobs: | ||
coverage: | ||
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 | ||
- name: Checkout wiki | ||
uses: actions/checkout@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
repository: ${{github.repository}}.wiki | ||
path: ./.github/wiki/ | ||
python-version: 3.10 | ||
|
||
- 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: Checkout gh-pages | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: gh-pages | ||
|
||
- name: Create Badges | ||
shell: bash | ||
run: | | ||
coverage run --source study_lyte -m pytest | ||
coverage xml | ||
mkdir -p badges | ||
genbadge coverage -i coverage.xml -o badges/coverage.svg | ||
genbadge coverage -i coverage.xml -o .github/wiki/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 }} | ||
- name: Push to wiki | ||
shell: bash | ||
run: | | ||
cd ./.github/wiki/ | ||
git add --all | ||
git diff-index --quiet HEAD && exit | ||
git config --local user.name "GitHub Action" | ||
git config --local user.email "[email protected]" | ||
git commit --amend --no-edit && git push --force-with-lease || \ | ||
git commit -m"Update coverage" && git push |