-
Notifications
You must be signed in to change notification settings - Fork 588
49 lines (44 loc) · 1.61 KB
/
build-and-test-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
name: Build and test
on: [push, pull_request]
jobs:
setup:
name: Setup runners
runs-on: ubuntu-latest
if: github.repository == 'rr-debugger/rr'
steps:
- id: generate
name: Generate runner label
run: |
RUNNER_LABEL=rr_runner_$(uuidgen|tr -d -)
echo "RUNNER_LABEL=$RUNNER_LABEL" >> "$GITHUB_OUTPUT"
- name: Start runners
run: |2-
curl --fail -s -X POST -H "Content-Type: application/json" --data "{\"operation\": \"create\", \"architectures\":[\"x86_64\", \"arm64\"], \"label\": \"${{ steps.generate.outputs.RUNNER_LABEL }}\"}" https://bqugdqmvcql6yvz4i362qohyea0namsk.lambda-url.us-east-2.on.aws
outputs:
RUNNER_LABEL: ${{ steps.generate.outputs.RUNNER_LABEL }}
x86-64:
uses: ./.github/workflows/build-and-test.yml
needs: setup
if: github.repository == 'rr-debugger/rr'
with:
label: ${{ needs.setup.outputs.RUNNER_LABEL }}
architecture: x86_64
arm64:
uses: ./.github/workflows/build-and-test.yml
needs: setup
if: github.repository == 'rr-debugger/rr'
with:
label: ${{ needs.setup.outputs.RUNNER_LABEL }}
architecture: arm64
stop-runners:
name: Stop runners
runs-on: ubuntu-latest
needs:
- setup
- x86-64
- arm64
if: ${{ always() && github.repository == 'rr-debugger/rr' }}
steps:
- name: "Stop runners"
run: |2-
curl --fail -s -X POST -H "Content-Type: application/json" --data "{\"operation\": \"destroy\", \"label\": \"${{ needs.setup.outputs.RUNNER_ID }}\"}" https://bqugdqmvcql6yvz4i362qohyea0namsk.lambda-url.us-east-2.on.aws