Repository navigation
73 lines (67 loc) · 2.07 KB
/
Copy pathbuild-harnesses.yml
File metadata and controls
73 lines (67 loc) · 2.07 KB
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
name: Build harnesses
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
discover:
name: Select harnesses
runs-on: ubuntu-24.04
timeout-minutes: 5
outputs:
harnesses: ${{ steps.select.outputs.harnesses }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Select changed harnesses
id: select
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: python3 .github/scripts/select-harnesses.py
build:
name: Build (${{ matrix.harness }})
needs: discover
if: needs.discover.outputs.harnesses != '[]'
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
harness: ${{ fromJSON(needs.discover.outputs.harnesses) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Build container image
env:
HARNESS: ${{ matrix.harness }}
run: docker build --tag "byo-ext/${HARNESS}:ci" "harnesses/${HARNESS}"
summary:
name: Harness builds
needs: [discover, build]
if: always()
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check build results
env:
DISCOVERY_RESULT: ${{ needs.discover.result }}
BUILD_RESULT: ${{ needs.build.result }}
run: |
if [[ "$DISCOVERY_RESULT" != "success" ]]; then
echo "Harness selection failed or was cancelled."
exit 1
fi
if [[ "$BUILD_RESULT" != "success" && "$BUILD_RESULT" != "skipped" ]]; then
echo "A harness build failed or was cancelled."
exit 1
fi
echo "All selected harnesses built successfully, or no builds were needed."