-
Notifications
You must be signed in to change notification settings - Fork 33
48 lines (45 loc) · 1.36 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
name: tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
changed_states:
runs-on: ubuntu-latest
steps:
- id: files
uses: jitterbit/get-changed-files@v1
with:
format: "json"
- id: filter
run: |
echo "filtered_files=$(jq -rMc '[.[] | select(. | contains(".sls")) | select(. | contains("init") | not) | sub("/"; "."; "g") | sub(".sls"; ""; "g")]' <<< '${{ steps.files.outputs.added_modified }}')" > $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.filter.outputs.filtered_files }}
test_states:
needs: changed_states
runs-on: ubuntu-latest
if: ${{ needs.changed_states.outputs.matrix != '[]' }}
strategy:
matrix:
salt: [3006]
os: [20.04, 22.04]
state: ${{ fromJson(needs.changed_states.outputs.matrix) }}
include:
- os: 20.04
code: focal
- os: 22.04
code: jammy
exclude:
- os: 22.04
salt: 3004
container:
image: docker://ghcr.io/ekristen/cast-tools/saltstack-tester:${{ matrix.code }}-${{ matrix.salt }}
steps:
- uses: actions/checkout@v4
- name: test-state
run: |
salt-call -l info --file-root . --local --retcode-passthrough --state-output=mixed state.sls ${{ matrix.state }} pillar="{sift_user: root}"