forked from saltstack/salt-winrepo-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.62 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
name: Test on Windows
on:
- pull_request
- push
- workflow_call
- workflow_dispatch
jobs:
gsv:
name: Get Salt versions
runs-on: ubuntu-latest
outputs:
salt-latest: ${{ steps.get-salt-versions.outputs.salt-latest }}
steps:
- id: get-salt-versions
uses: dafyddj/get-salt-versions@v2
test:
name: Run URL tests
needs: gsv
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- id: changed-files
name: Get changed files
uses: dorny/paths-filter@v2
with:
list-files: json
filters: |
sls:
- added|modified:
- '**/*.sls'
- name: Setup Salt
if: steps.changed-files.outputs.sls == 'true'
uses: dafyddj/setup-salt-win@v2
with:
salt-version: ${{ needs.gsv.outputs.salt-latest }}
- name: Setup `pip` dependencies
if: steps.changed-files.outputs.sls == 'true'
run: |
salt-call state.single pip.installed name=dependencies `
pkgs='["python-magic-bin", "tabulate"]' `
cwd='C:\Program Files\Salt Project\Salt\bin\Scripts' `
bin_env='C:\Program Files\Salt Project\Salt\bin\Scripts\pip.exe'
if ($LASTEXITCODE) {
Write-Host ("::error title=salt-call::salt-call returned exit code: $LASTEXITCODE")
exit 1
}
- name: Run URL test
if: steps.changed-files.outputs.sls == 'true'
run: |
& "C:\Program Files\Salt Project\Salt\bin\python.exe" .\.cicd\tests.py ${{ join(fromJSON(steps.changed-files.outputs.sls_files), ' ') }}