|
12 | 12 | push: |
13 | 13 | paths: |
14 | 14 | - client/** |
| 15 | + - .github/workflows/ci-scripts-build.yml |
15 | 16 | pull_request: |
16 | 17 | paths: |
17 | 18 | - client/** |
| 19 | + - .github/workflows/ci-scripts-build.yml |
18 | 20 |
|
19 | 21 | env: |
20 | 22 | SETUP_PATH: .ci-local:.ci |
21 | 23 | EPICS_TEST_IMPRECISE_TIMING: YES |
22 | 24 |
|
23 | 25 | jobs: |
| 26 | + prepare_matrix: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + outputs: |
| 29 | + matrix: ${{ steps.set_matrix.outputs.matrix }} |
| 30 | + steps: |
| 31 | + - name: Checkout runner-images repository |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + repository: 'actions/runner-images' |
| 35 | + path: 'runner-images' |
| 36 | + |
| 37 | + - name: Generate matrix of supported images |
| 38 | + id: set_matrix |
| 39 | + run: | |
| 40 | + # This script will find all the JSON files for Linux, Windows, and macOS images, |
| 41 | + # extract the 'imageName' field, and create a JSON array. |
| 42 | + # We are targeting the image definitions that contain version numbers, and creating |
| 43 | + # separate lists for each OS. |
| 44 | + images=$(find runner-images/images -name "*.json" -type f -exec grep -l '"imageName":' {} + | xargs -I {} grep -o '"imageName": "[^"]*' {} | sed 's/"imageName": "//' | grep -E 'ubuntu-2[2-9]\.04|windows-202[2-9]|macos-1[3-9]') |
| 45 | + linux_images=$(echo "$images" | grep "ubuntu" | jq -R . | jq -s .) |
| 46 | + macos_images=$(echo "$images" | grep "macos" | jq -R . | jq -s .) |
| 47 | + windows_images=$(echo "$images" | grep "windows" | jq -R . | jq -s .) |
| 48 | + echo "matrix={\"linux\":${linux_images}, \"macos\":${macos_images}, \"windows\":${windows_images}}" >> $GITHUB_OUTPUT |
24 | 49 |
|
25 | 50 | build-linux: |
| 51 | + needs: prepare_matrix |
26 | 52 | defaults: |
27 | 53 | run: |
28 | 54 | working-directory: client |
|
34 | 60 | strategy: |
35 | 61 | fail-fast: false |
36 | 62 | matrix: |
37 | | - os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04] |
| 63 | + os: ${{ fromJSON(needs.prepare_matrix.outputs.matrix).linux }} |
38 | 64 | cmp: [gcc, clang] |
39 | 65 | configuration: [default, static, debug, static-debug] |
40 | 66 | steps: |
|
51 | 77 | run: python .ci/cue.py test-results |
52 | 78 |
|
53 | 79 | build-macos: |
| 80 | + needs: prepare_matrix |
54 | 81 | defaults: |
55 | 82 | run: |
56 | 83 | working-directory: client |
|
62 | 89 | strategy: |
63 | 90 | fail-fast: false |
64 | 91 | matrix: |
65 | | - os: [macos-14, macos-13] |
| 92 | + os: ${{ fromJSON(needs.prepare_matrix.outputs.matrix).macos }} |
66 | 93 | cmp: [clang] |
67 | 94 | configuration: [default, debug] |
68 | 95 | steps: |
|
90 | 117 | strategy: |
91 | 118 | fail-fast: false |
92 | 119 | matrix: |
93 | | - os: [windows-2022, windows-2019] |
| 120 | + os: ${{ fromJSON(needs.prepare_matrix.outputs.matrix).windows }} |
94 | 121 | cmp: [gcc, vs2022, vs2019] |
95 | 122 | configuration: [default, static, debug, static-debug] |
96 | 123 | exclude: |
|
0 commit comments