-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (59 loc) · 1.58 KB
/
tests.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
name: "Run tests"
on:
push:
branches-ignore:
- main
workflow_call:
workflow_dispatch:
jobs:
run-linters:
name: "Run linters"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install requirements
run: |
make init
- name: Run linters
run: |
make lint
prepare-matrix:
needs: run-linters
name: "Prepare matrix"
runs-on: ubuntu-20.04
outputs:
molecule-scenarios: ${{ steps.set-matrix.outputs.molecule-scenarios }}
steps:
- uses: actions/checkout@v3
- name: List molecule scenarios
id: set-matrix
run: |
MOLECULE_SCENARIOS=$(find molecule/ -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | jq -ncR '[inputs]')
echo "molecule-scenarios=${MOLECULE_SCENARIOS}" >> $GITHUB_OUTPUT
tests:
needs: prepare-matrix
strategy:
fail-fast: false
matrix:
scenario: ${{ fromJson(needs.prepare-matrix.outputs.molecule-scenarios) }}
name: "Run tests"
# cgroup version shouldn't be cgroup2fs, check:
# stat -c %T -f /sys/fs/cgroup
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install requirements
run: |
make init
- name: Run tests
run: |
molecule test --scenario-name "${{ matrix.scenario }}"
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'