Skip to content

Update actions/checkout to latest version #24

Update actions/checkout to latest version

Update actions/checkout to latest version #24

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