Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ci): only run ARM on master #5705

Merged
merged 13 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/ci-setup-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ inputs:
dockerhub_password:
required: true
description: 'DockerHub Password'
concurrency_key:
required: false
description: 'Concurrency key for locking jobs'
concurrency_token:
required: false
description: 'Must be provided with concurrency key. GH token used to lock this job.'
runs:
# define an action, runs in OS of caller
using: composite
Expand Down Expand Up @@ -56,3 +62,13 @@ runs:
else
echo "Docker daemon already configured."
fi
# As detailed in https://github.com/ben-z/gh-action-mutex
# things do not become 'pending' in github actions, and instead just cancel one another
# so we can't use the native concurrency in GA
- name: Limit concurrency
uses: ben-z/[email protected]
if: ${{ inputs.concurrency_key }}
with:
repo-token: ${{ inputs.concurrency_token }}
repository: AztecProtocol/git-metadata
branch: gh-actions-mutex-${{ inputs.concurrency_key }}
70 changes: 70 additions & 0 deletions .github/workflows/ci-arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI
on:
push:
branches: [master]
workflow_dispatch:
inputs:
runner_action:
description: "The action to take with the self-hosted runner (start, stop, restart)."
required: false
just_start_spot:
description: "Should we just run spots?"
type: boolean
required: false
concurrency:
# force parallelism in master, cancelling in branches (only relevant to workflow_dispatch)
group: ci-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}
cancel-in-progress: true
jobs:
setup:
uses: ./.github/workflows/setup-runner.yml
with:
runner_label: master-arm
ebs_cache_size_gb: 128
runner_concurrency: 8
ec2_instance_type: r6g.16xlarge
ec2_ami_id: ami-0d8a9b0419ddb331a
ec2_instance_ttl: 40 # refreshed by jobs
secrets: inherit

build:
needs: setup
runs-on: master-arm
timeout-minutes: 40
steps:
- {uses: actions/checkout@v4, with: { ref: "${{ github.event.pull_request.head.sha }}"}}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_token: "${{ secrets.AZTEC_GITHUB_TOKEN }}"
# must be globally unique for build x runner
concurrency_key: build-master-arm
# prepare images locally, tagged by commit hash
- run: earthly ./yarn-project+export-end-to-end

# all the end-to-end integration tests for aztec
e2e:
needs: build
runs-on: master-arm
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
test:
- e2e-card-game
- e2e-crowdfunding-and-claim
steps:
- {uses: actions/checkout@v4, with: { ref: "${{ github.event.pull_request.head.sha }}"}}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_token: "${{ secrets.AZTEC_GITHUB_TOKEN }}"
concurrency_key: e2e-master-arm
# Ensure that a test only ever is running one e2e at a time
- name: Set up mutex
uses: ben-z/[email protected]
with:
branch: gh-action-mutex-e2e-arm-master-${{ matrix.test }}
- name: Test
working-directory: ./yarn-project/end-to-end/
run: earthly -P --no-output +${{ matrix.test }} --e2e_mode=cache
Loading
Loading