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