Repository navigation
134 lines (127 loc) · 4.25 KB
/
Copy pathci.yml
File metadata and controls
134 lines (127 loc) · 4.25 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Terrabuild CI
on:
workflow_call:
inputs:
suffix:
type: string
required: true
require-changelog:
type: boolean
default: false
secrets:
TERRABUILD_TOKEN:
required: false
TERRABUILD_MASTER_KEY:
required: false
concurrency:
group: fscript-ci-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
checks: write
packages: read
env:
TERRABUILD_GROUP: ${{ github.repository }}:${{ github.run_id }}:${{ github.run_attempt }}
jobs:
build:
permissions:
contents: read
checks: write
packages: write
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
matrix: ${{ steps.shards.outputs.matrix }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enforce changelog updates
env:
REQUIRE_CHANGELOG_ALWAYS: ${{ inputs.require-changelog }}
run: .github/scripts/check-unreleased-changelog.sh
- name: Verify release formatting
run: make test-release-changelog
- name: Setup Tools
id: setup-tools
uses: ./.github/actions/setup-tools
with:
terrabuild_workspace: "6ae115ba87040d459b6ccf40"
TERRABUILD_TOKEN: ${{ secrets.TERRABUILD_TOKEN }}
TERRABUILD_MASTER_KEY: ${{ secrets.TERRABUILD_MASTER_KEY }}
GITHUB_TOKEN: ${{ github.token }}
- name: Read static test matrix
id: shards
run: node -e 'console.log("matrix=" + JSON.stringify(require("./.build/ci-shards.json")))' >> "$GITHUB_OUTPUT"
- name: Build and populate the Terrabuild cache
run: make build TB_FLAGS="${TB_FLAGS:-} --debug --log"
- name: Logout from Terrabuild
if: always() && steps.setup-tools.outputs.connected == 'true'
run: terrabuild logout --space "6ae115ba87040d459b6ccf40"
- name: Collect build diagnostics
if: always()
uses: ./.github/actions/collect-build-results
with:
suffix: ${{ inputs.suffix }}-build
publish: 'false'
tests:
needs: build
name: Tests (${{ matrix.name }})
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.build.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Tools
id: setup-tools
uses: ./.github/actions/setup-tools
with:
terrabuild_workspace: "6ae115ba87040d459b6ccf40"
TERRABUILD_TOKEN: ${{ secrets.TERRABUILD_TOKEN }}
TERRABUILD_MASTER_KEY: ${{ secrets.TERRABUILD_MASTER_KEY }}
GITHUB_TOKEN: ${{ github.token }}
- name: Run selected tests and restore their reports
env:
CI_SHARD: ${{ matrix.name }}
run: node .github/scripts/run-ci-shard.mjs "$CI_SHARD"
- name: Logout from Terrabuild
if: always() && steps.setup-tools.outputs.connected == 'true'
run: terrabuild logout --space "6ae115ba87040d459b6ccf40"
- name: Collect shard results and diagnostics
if: always()
uses: ./.github/actions/collect-build-results
with:
suffix: ${{ inputs.suffix }}-${{ matrix.name }}
publish: 'false'
build-and-test:
name: Build and test
needs: [build, tests]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Gather shard test results
if: needs.tests.result != 'skipped'
uses: actions/download-artifact@v4
with:
pattern: test-results-${{ inputs.suffix }}-*
path: .out/ci-results
merge-multiple: false
- name: Publish combined test reports
if: always() && needs.tests.result != 'skipped'
uses: ./.github/actions/publish-test-results
with:
suffix: ${{ inputs.suffix }}
path: .out/ci-results
- name: Require the build and every shard to pass
if: always()
env:
BUILD_RESULT: ${{ needs.build.result }}
TEST_RESULT: ${{ needs.tests.result }}
run: |
test "$BUILD_RESULT" = success
test "$TEST_RESULT" = success