forked from nmstate/nmstate
-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (128 loc) · 3.77 KB
/
main.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
rust_lint:
strategy:
fail-fast: true
matrix:
include:
- rust_version: "stable"
- rust_version: "nightly"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust ${{ matrix.rust_version }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust_version }}
override: true
components: rustfmt, clippy
- name: Check fmt
if: matrix.rust_version == 'stable'
run: cd rust && cargo fmt -- --check
- name: Check clippy
if: matrix.rust_version == 'nightly'
run: cd rust && cargo clippy -- -D warnings
rust_unit:
strategy:
fail-fast: true
matrix:
include:
- rust_version: "stable"
- rust_version: "nightly"
- rust_version: "beta"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Rust ${{ matrix.rust_version }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust_version }}
override: true
- name: Unit test
run: cd rust && cargo test -- --test-threads=1 --show-output
rpm_build:
runs-on: ubuntu-latest
needs: [rust_lint, py_lint]
steps:
- uses: actions/checkout@v3
- name: build nmstate rpm
run: .github/workflows/build_rpm.sh
- uses: actions/upload-artifact@v3
with:
name: rpms
path: rpms/
retention-days: 5
py_lint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- job_type: "c8s-nm_stable-format"
- job_type: "c8s-nm_stable-lint"
steps:
- uses: actions/checkout@v3
- name: Run tests
run: .github/workflows/run_test.sh ${{ matrix.job_type }}
py_unit:
runs-on: ubuntu-latest
needs: rpm_build
strategy:
fail-fast: false
matrix:
include:
- job_type: "c8s-nm_stable-unit_py36"
steps:
- uses: actions/checkout@v3
- name: Download compiled rpm
uses: actions/download-artifact@v3
with:
name: rpms
path: rpms/
- name: Run tests
run: .github/workflows/run_test.sh ${{ matrix.job_type }}
integ:
runs-on: ubuntu-latest
needs: rpm_build
strategy:
fail-fast: false
matrix:
include:
- job_type: "c8s-nm_stable-integ_tier1"
- job_type: "c8s-nm_stable-integ_tier2"
- job_type: "c8s-nm_stable-integ_slow"
- job_type: "c8s-nm_stable-integ_rust"
- job_type: "c8s-nm_stable-rust_go"
- job_type: "c8s-nm_main-integ_tier1"
- job_type: "c8s-nm_main-integ_tier2"
- job_type: "c8s-nm_main-integ_slow"
- job_type: "c8s-nm_main-integ_rust"
- job_type: "c8s-nm_main-integ_rust_slow"
- job_type: "c8s-nm_main-rust_go"
- job_type: "ovs2_11-nm_stable-integ_tier1"
- job_type: "vdsm_el8-nm_main-vdsm"
steps:
- uses: actions/checkout@v3
- name: Enable openvswitch kernel module
run: sudo modprobe openvswitch
- name: Download compiled rpm
uses: actions/download-artifact@v3
with:
name: rpms
path: rpms/
- name: Run tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: .github/workflows/run_test.sh ${{ matrix.job_type }}
- name: Set artifacts permissions
if: ${{ failure() }}
run: sudo chmod 777 test_artifacts/*
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: nmstate-test-artifact-${{ matrix.job_type }}
path: test_artifacts/
retention-days: 5