-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (67 loc) · 1.8 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
---
# yamllint disable rule:truthy rule:truthy rule:line-length
name: "CI"
on:
pull_request:
push:
branches:
- develop
- main
- stable
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: "ubuntu-latest"
timeout-minutes: 5
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: "Setup environment"
run: |
pipx install poetry
pip install invoke toml
- name: "Install Linters"
run: "poetry install --only=dev"
- name: "Linting"
run: "poetry run invoke lint"
python-tests:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
if: |
always() && !cancelled() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
needs: ["lint"]
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
- name: "Check out repository code"
uses: "actions/checkout@v3"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: "Setup environment"
run: |
pipx install poetry
pip install invoke toml
- name: "Install Nornir Infrahub"
run: "poetry install"
- name: "Pytest Tests"
run: "poetry 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