generated from allenai/python-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.66 KB
/
ci.yml
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
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install .[dev]
- name: Run tests
run: |
pytest
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: coverage.py badge
uses: tj-actions/[email protected]
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: coverage.svg
- name: 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: 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.ref }}
- name: Re-pull on failure
if: ${{ failure() }}
run: git pull origin ${{ github.ref }} --autostash --rebase -X ours
- name: Re-push on failure
if: ${{ failure() }}
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}