-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (52 loc) · 1.78 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
on:
pull_request:
branches: [main]
jobs:
main:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.8, 3.9, "3.10", 3.11 ]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
ref: ${{ github.event.pull_request.head.ref }}
- name: Run pre-commit hooks
uses: pre-commit/[email protected]
- name: Run pre-commit CI
uses: pre-commit-ci/[email protected]
if: always()
- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Install
run: make install-ci
- name: Test
run: make test
- name: Coverage
if: matrix.python-version == '3.11'
run: make coverage
- name: Coverage Badge
if: matrix.python-version == '3.11'
uses: tj-actions/coverage-badge-py@v2
- name: Verify Changed files
if: matrix.python-version == '3.11'
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: coverage.svg
- name: Coverage Commit files
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add coverage.svg
git commit -m "Updated coverage.svg"
- name: Coverage Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.github_token }}
branch: ${{ github.head_ref }}