-
Notifications
You must be signed in to change notification settings - Fork 551
93 lines (79 loc) · 2.9 KB
/
test-macos.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
name: Test MacOS
on:
workflow_call:
inputs:
distro-slug:
type: string
required: true
description: The Distribution Slug
display-name:
type: string
required: true
description: The Display Name For The Job
runs-on:
type: string
required: true
description: The GitHub MacOS Worker To Run Workflow On
instances:
type: string
required: true
description: The Instances To Test
container-slug:
type: string
required: true
description: The Container Slug
timeout:
type: number
required: false
default: 20
description: The timeout(in minutes) for the workflow
jobs:
Test:
name: ${{ matrix.instance }}
runs-on: ${{ inputs.runs-on }}
## runs-on: macos-13
timeout-minutes: ${{ inputs.timeout }}
strategy:
fail-fast: false
matrix:
instance: ${{ fromJSON(inputs.instances) }}
steps:
- uses: actions/checkout@v4
- name: Install Python Dependencies with pip breakage
if: ${{ ( inputs.distro-slug != 'macos-12' ) && ( inputs.distro-slug != 'macos-13' ) }}
run: |
python3 -m pip install --break-system-packages -r tests/requirements.txt
- name: Install Python Dependencies without pip breakage
if: ${{ ( inputs.distro-slug == 'macos-12' ) || ( inputs.distro-slug == 'macos-13' ) }}
run: |
python3 -m pip install -r tests/requirements.txt
- name: Get Version
run: |
# We need to get the version here and make it an environment variable
# It is used to install via bootstrap and in the test
# The version is in the instance name
# sed 1st - becomes space, 2nd - becomes dot
vt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./')
vt_parm_ver=$(echo "$vt_parms" | awk -F ' ' '{print $2}')
echo "SaltVersion=$vt_parm_ver" >> $GITHUB_ENV
- name: Bootstrap Salt
run: |
# sed 1st - becomes space, 2nd - becomes dot
bt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./')
bt_arg1=$(echo "$bt_parms" | awk -F ' ' '{print $1}')
bt_arg2=$(echo "$bt_parms" | awk -F ' ' '{print $2}')
sudo sh ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
- name: Test Bootstrap
run: |
pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v4
with:
name: exitstatus-${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
path: exitstatus/