1
+ name : arm flow
2
+
3
+ on :
4
+ push :
5
+ paths-ignore :
6
+ - ' docs/**'
7
+ - ' README.md'
8
+ branches :
9
+ - master
10
+ - ' [0-9].[0-9]'
11
+ - ' [0-9].[0-9].[0-9]'
12
+ pull_request :
13
+ workflow_dispatch :
14
+
15
+ concurrency :
16
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-buildarm64
17
+ cancel-in-progress : true
18
+
19
+ permissions :
20
+ contents : read
21
+ packages : write
22
+
23
+ jobs :
24
+
25
+ start-arm64-runner :
26
+ name : Start self-hosted EC2 runner
27
+ runs-on : ubuntu-latest
28
+ outputs :
29
+ label : ${{ steps.start-ec2-runner.outputs.label }}
30
+ ec2-instance-id : ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
31
+ steps :
32
+ - name : Configure AWS credentials
33
+ uses : aws-actions/configure-aws-credentials@v2
34
+ with :
35
+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
36
+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
37
+ aws-region : ${{ secrets.AWS_REGION_ID }}
38
+ - name : Start EC2 runner
39
+ id : start-ec2-runner
40
+ uses : machulav/ec2-github-runner@v2
41
+ with :
42
+ mode : start
43
+ github-token : ${{ secrets.GH_ACCESS_TOKEN }}
44
+ ec2-image-id : ${{ secrets.AWS_AMI_ID }}
45
+ ec2-instance-type : t4g.medium
46
+ subnet-id : ${{ secrets.AWS_SUBNET_ID }}
47
+ security-group-id : ${{ secrets.AWS_SECGROUP_ID }}
48
+
49
+ ubuntu-bionic-arm64 :
50
+ needs : start-arm64-runner
51
+ uses : ./.github/workflows/BUILD-REUSABLE.yml
52
+ with :
53
+ docker_image : ubuntu:18.04
54
+ deps : apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget
55
+ osnick : ubuntu18.04
56
+ arch : arm64
57
+ secrets : inherit
58
+
59
+ ubuntu-focal-arm64 :
60
+ needs : start-arm64-runner
61
+ uses : ./.github/workflows/BUILD-REUSABLE.yml
62
+ with :
63
+ docker_image : ubuntu:20.04
64
+ deps : apt-get update -qq && apt-get install -qqy build-essential libssl-dev python3 python3-pip jq wget
65
+ osnick : ubuntu20.04
66
+ arch : arm64
67
+ secrets : inherit
68
+
69
+ stop-arm64-runner :
70
+ name : Stop self-hosted EC2 runner
71
+ needs :
72
+ - start-arm64-runner
73
+ - ubuntu-bionic-arm64
74
+ - ubuntu-focal-arm64
75
+ runs-on : ubuntu-latest
76
+ if : ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
77
+ steps :
78
+ - name : Configure AWS credentials
79
+ uses : aws-actions/configure-aws-credentials@v2
80
+ with :
81
+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
82
+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
83
+ aws-region : ${{ secrets.AWS_REGION_ID }}
84
+ - name : Stop EC2 runner
85
+ uses : machulav/ec2-github-runner@v2
86
+ with :
87
+ mode : stop
88
+ github-token : ${{ secrets.GH_ACCESS_TOKEN }}
89
+ label : ${{ needs.start-arm64-runner.outputs.label }}
90
+ ec2-instance-id : ${{ needs.start-arm64-runner.outputs.ec2-instance-id }}
0 commit comments