Skip to content

Commit 6959602

Browse files
authored
ci: use arm runners for arm64 workflows (#604)
1 parent 5c2be70 commit 6959602

File tree

1 file changed

+10
-31
lines changed

1 file changed

+10
-31
lines changed

.github/workflows/build-and-test.yml

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ jobs:
3535
os: [
3636
macos-13,
3737
ubuntu-latest,
38-
windows-latest,
38+
windows-latest
3939
]
4040
docker: [false]
4141
alpine: [false]
4242
arch: ['amd64']
4343
include:
44-
- os: ubuntu-latest
45-
docker: true
44+
- os: ubuntu-24.04-arm
45+
docker: false
4646
alpine: false
4747
arch: arm64
48-
- os: ubuntu-latest
48+
- os: ubuntu-24.04-arm
4949
docker: true
5050
alpine: true
5151
arch: arm64
@@ -75,9 +75,6 @@ jobs:
7575
- if: runner.os == 'Windows'
7676
run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV
7777

78-
- name: Set up QEMU
79-
if: ${{ matrix.docker == true && matrix.arch == 'arm64' }}
80-
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
8178
- if: ${{ matrix.docker == true && matrix.alpine == true }}
8279
name: prebuild linux ${{ matrix.arch }} musl
8380
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:20-alpine bin/sh -c 'apk add bash && cd /home && bash -c "/home/script/ci/prebuild-alpine.sh" && rm -rf ffi node_modules'
@@ -113,15 +110,10 @@ jobs:
113110
fail-fast: false
114111
matrix:
115112
node-version: [16, 18, 20, 22]
116-
os: [macos-14, macos-13, ubuntu-latest, windows-latest]
113+
os: [macos-14, macos-13, ubuntu-latest, windows-latest, ubuntu-24.04-arm]
117114
docker: [false]
118115
include:
119-
- os: ubuntu-latest
120-
docker: true
121-
alpine: false
122-
arch: arm64
123-
node-version: 22
124-
- os: ubuntu-latest
116+
- os: ubuntu-24.04-arm
125117
docker: true
126118
alpine: true
127119
arch: arm64
@@ -131,12 +123,7 @@ jobs:
131123
alpine: true
132124
arch: amd64
133125
node-version: 22
134-
- os: ubuntu-latest
135-
docker: true
136-
alpine: false
137-
arch: arm64
138-
node-version: 20
139-
- os: ubuntu-latest
126+
- os: ubuntu-24.04-arm
140127
docker: true
141128
alpine: true
142129
arch: arm64
@@ -146,7 +133,7 @@ jobs:
146133
alpine: true
147134
arch: amd64
148135
node-version: 20
149-
- os: ubuntu-latest
136+
- os: ubuntu-24.04-arm
150137
docker: true
151138
alpine: true
152139
arch: arm64
@@ -184,19 +171,11 @@ jobs:
184171
- run: LOG_LEVEL=debug ./script/ci/unpack-and-test.sh
185172
if: ${{ matrix.docker != true }}
186173

187-
- name: Set up QEMU
188-
if: ${{ matrix.docker == true && matrix.arch == 'arm64' }}
189-
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
190-
191-
- if: ${{ matrix.docker == true && matrix.alpine != true && matrix.arch == 'arm64' }}
192-
name: test arm64
193-
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }} bin/bash -c 'cd /home && /home/script/ci/unpack-and-test.sh'
194-
195-
- if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'amd64' }}
174+
- if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'amd64' && matrix.os == 'ubuntu-latest' }}
196175
name: test linux amd64 musl
197176
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash curl gcompat file && cd /home && /home/script/ci/unpack-and-test.sh'
198177

199-
- if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'arm64' }}
178+
- if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'arm64' && matrix.os == 'ubuntu-24.04-arm' }}
200179
name: test linux arm64 musl
201180
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }}-alpine bin/sh -c 'apk add bash curl file protoc protobuf-dev && cd /home && /home/script/ci/unpack-and-test.sh'
202181

0 commit comments

Comments
 (0)