-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (67 loc) · 1.79 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
# yamllint disable rule:truthy rule:truthy rule:line-length
name: "CI"
on:
pull_request:
push:
branches:
- develop
- stable
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# env:
# XXX
jobs:
yaml-lint:
if: needs.files-changed.outputs.yaml == 'true'
runs-on: "ubuntu-latest"
timeout-minutes: 5
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Setup environment"
run: "pip install yamllint==1.29.0"
- name: "Linting: yamllint"
run: "yamllint ."
python-lint:
if: needs.files-changed.outputs.python == 'true'
runs-on: "ubuntu-latest"
timeout-minutes: 5
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Setup environment"
run: "pip install black==23.1.0 ruff==0.0.265"
- name: "Linting: BLACK"
run: "black --check ."
- name: "Linting: ruff"
run: "ruff check ."
python-tests:
if: |
always() && !cancelled() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
needs: ["yaml-lint", "python-lint"]
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Install Poetry"
run: "pipx install poetry"
- name: "Pytest Tests"
run: "pytest -v tests/"
coverall-report:
needs: ["python-tests"]
if: |
always() && !cancelled()
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: coverallsapp/github-action@v2
env:
COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
with:
carryforward: "nornir-unit"
parallel-finished: true