-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (82 loc) · 2.86 KB
/
build-linux-aarch64.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
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
name: arm flow
on:
push:
paths-ignore:
- 'docs/**'
- 'README.md'
branches:
- master
- '[0-9].[0-9]'
- '[0-9].[0-9].[0-9]'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-buildarm64
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
start-arm64-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION_ID }}
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
ec2-image-id: ${{ secrets.AWS_AMI_ID }}
ec2-instance-type: t4g.small
subnet-id: ${{ secrets.AWS_SUBNET_ID }}
security-group-id: ${{ secrets.AWS_SECGROUP_ID }}
ubuntu-bionic-arm64:
needs: start-arm64-runner
uses: ./.github/workflows/REUSABLE-linux.yml
with:
docker_image: ubuntu:18.04
deps: apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget
osnick: ubuntu18.04
arch: arm64
secrets: inherit
ubuntu-focal-arm64:
needs: start-arm64-runner
uses: ./.github/workflows/REUSABLE-linux.yml
with:
docker_image: ubuntu:20.04
deps: apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget
osnick: ubuntu20.04
arch: arm64
secrets: inherit
stop-arm64-runner:
name: Stop self-hosted EC2 runner
needs:
- start-arm64-runner
- ubuntu-bionic-arm64
- ubuntu-focal-arm64
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION_ID }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
label: ${{ needs.start-arm64-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-arm64-runner.outputs.ec2-instance-id }}