-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (68 loc) · 2 KB
/
lint-test-tag.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Lint And Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
linter:
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: Run linter
run: |
sh utils/lint.sh
tests:
needs: linter
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Install project
run: pip install .
- name: Run tests
run: |
pytest -v --cov-report term --cov-report xml --cov-report html --cov-config .coveragerc --cov=staflversion -l --tb=short --maxfail=1 tests/
tag:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # for accurate versioning
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ACTIONS_SSH_PRIVATE_KEY }}
- name: Determine Version
id: staflversion
uses: StaflSystems/CustomGithubActions/DetermineVersion@main
- name: Create a GitHub release
if: github.ref == 'refs/heads/main'
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.staflversion.outputs.full }}