detached 91e14e1

.github/workflows: test linux/arm64 on a native GHA runner (#348)

GitHub Actions supports native Linux ARM64 runners.
We can use them instead of running QEMU on Intel.

While here, move the loong64-related steps into their own job.
This makes the yml simpler and the actions execution around 1 minute faster.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
commit
91e14e1f9173e8b82e891513a8b0316d53312ff6
author
Quim Muntal · · 2025-10-16 18:08 UTC
committer
GitHub · · 2025-10-16 18:08 UTC
parent
8e5400e
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
1 file · +34 -37
M .github/workflows/test.yml +34 -37
@@ -6,7 +6,7 @@ jobs:
66 test:
77 strategy:
88 matrix:
9- os: [ubuntu-latest, macos-latest, windows-latest]
9+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
1010 go: ['1.18.x', '1.19.x', '1.20.x', '1.21.x', '1.22.x', '1.23.x', '1.24.x', '1.25.x']
1111 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
1212 runs-on: ${{ matrix.os }}
@@ -28,12 +28,6 @@ jobs:
2828 with:
2929 go-version: ${{ matrix.go }}
3030
31- - name: Set up the prerequisites
32- if: runner.os == 'Linux'
33- run: |
34- sudo apt-get update
35- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu qemu-user
36-
3731 - name: Set up the prerequisites
3832 if: runner.os == 'Windows'
3933 uses: msys2/setup-msys2@v2
@@ -113,35 +107,6 @@ jobs:
113107 env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./...
114108 env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./...
115109
116- - name: go test (Linux arm64)
117- if: runner.os == 'Linux'
118- run: |
119- go env -w CC=aarch64-linux-gnu-gcc
120- go env -w CXX=aarch64-linux-gnu-g++
121- env GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
122- env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
123- env GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
124- env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
125-
126- echo "=> go build (plugin)"
127- # Make sure that plugin buildmode works since we save the R15 register (#254)
128- env GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build -buildmode=plugin ./examples/libc
129-
130- go env -u CC
131- go env -u CXX
132-
133- - name: go test (Linux loong64)
134- if: ${{ runner.os == 'Linux' && !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') && !startsWith(matrix.go, '1.20.') && !startsWith(matrix.go, '1.21.') && !startsWith(matrix.go, '1.22.') && !startsWith(matrix.go, '1.23.') && !startsWith(matrix.go, '1.24.') }}
135- run: |
136- go env -w CC=loongarch64-linux-gnu-gcc-14
137- go env -w CXX=loongarch64-linux-gnu-g++-14
138- env GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
139- env QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu qemu-loongarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
140- env GOOS=linux GOARCH=loong64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
141- env QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu qemu-loongarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
142- go env -u CC
143- go env -u CXX
144-
145110 - name: go test (Windows 386)
146111 if: runner.os == 'Windows'
147112 run: |
@@ -149,8 +114,9 @@ jobs:
149114 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...
150115
151116 - name: go test (Linux 386)
152- if: runner.os == 'Linux'
117+ if: ${{ runner.os == 'Linux' && runner.arch != 'ARM64' }}
153118 run: |
119+ sudo apt-get update
154120 sudo apt-get install gcc-multilib
155121 sudo apt-get install g++-multilib
156122 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...
@@ -166,6 +132,37 @@ jobs:
166132 run: |
167133 env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./...
168134
135+ loong:
136+ strategy:
137+ matrix:
138+ # Loong64 support internal linking from go1.25.
139+ go: ['1.25.x']
140+ name: Test with Go ${{ matrix.go }} on Linux loong64
141+ runs-on: ubuntu-latest
142+ defaults:
143+ run:
144+ shell: bash
145+ steps:
146+ - uses: actions/checkout@v4
147+ - name: Setup Go
148+ uses: actions/setup-go@v5
149+ with:
150+ go-version: ${{ matrix.go }}
151+ - name: Set up the prerequisites
152+ run: |
153+ sudo apt-get update
154+ sudo apt-get install -y gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu qemu-user
155+ - name: go test (Linux loong64)
156+ run: |
157+ go env -w CC=loongarch64-linux-gnu-gcc-14
158+ go env -w CXX=loongarch64-linux-gnu-g++-14
159+ env GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
160+ env QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu qemu-loongarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
161+ env GOOS=linux GOARCH=loong64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
162+ env QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu qemu-loongarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
163+ go env -u CC
164+ go env -u CXX
165+
169166 bsd:
170167 strategy:
171168 matrix:
@@ -6,7 +6,7 @@ jobs:
6 test:6 test:
7 strategy:7 strategy:
8 matrix:8 matrix:
9- os: [ubuntu-latest, macos-latest, windows-latest]9+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
10 go: ['1.18.x', '1.19.x', '1.20.x', '1.21.x', '1.22.x', '1.23.x', '1.24.x', '1.25.x']10 go: ['1.18.x', '1.19.x', '1.20.x', '1.21.x', '1.22.x', '1.23.x', '1.24.x', '1.25.x']
11 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}11 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
12 runs-on: ${{ matrix.os }}12 runs-on: ${{ matrix.os }}
@@ -28,12 +28,6 @@ jobs:
28 with:28 with:
29 go-version: ${{ matrix.go }}29 go-version: ${{ matrix.go }}
30 30
31- - name: Set up the prerequisites
32- if: runner.os == 'Linux'
33- run: |
34- sudo apt-get update
35- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu qemu-user
36-
37 - name: Set up the prerequisites31 - name: Set up the prerequisites
38 if: runner.os == 'Windows'32 if: runner.os == 'Windows'
39 uses: msys2/setup-msys2@v233 uses: msys2/setup-msys2@v2
@@ -113,35 +107,6 @@ jobs:
113 env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./...107 env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./...
114 env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./...108 env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./...
115 109
116- - name: go test (Linux arm64)
117- if: runner.os == 'Linux'
118- run: |
119- go env -w CC=aarch64-linux-gnu-gcc
120- go env -w CXX=aarch64-linux-gnu-g++
121- env GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
122- env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
123- env GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
124- env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
125-
126- echo "=> go build (plugin)"
127- # Make sure that plugin buildmode works since we save the R15 register (#254)
128- env GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build -buildmode=plugin ./examples/libc
129-
130- go env -u CC
131- go env -u CXX
132-
133- - name: go test (Linux loong64)
134- if: ${{ runner.os == 'Linux' && !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') && !startsWith(matrix.go, '1.20.') && !startsWith(matrix.go, '1.21.') && !startsWith(matrix.go, '1.22.') && !startsWith(matrix.go, '1.23.') && !startsWith(matrix.go, '1.24.') }}
135- run: |
136- go env -w CC=loongarch64-linux-gnu-gcc-14
137- go env -w CXX=loongarch64-linux-gnu-g++-14
138- env GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
139- env QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu qemu-loongarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
140- env GOOS=linux GOARCH=loong64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
141- env QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu qemu-loongarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
142- go env -u CC
143- go env -u CXX
144-
145 - name: go test (Windows 386)110 - name: go test (Windows 386)
146 if: runner.os == 'Windows'111 if: runner.os == 'Windows'
147 run: |112 run: |
@@ -149,8 +114,9 @@ jobs:
149 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...114 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...
150 115
151 - name: go test (Linux 386)116 - name: go test (Linux 386)
152- if: runner.os == 'Linux'117+ if: ${{ runner.os == 'Linux' && runner.arch != 'ARM64' }}
153 run: |118 run: |
119+ sudo apt-get update
154 sudo apt-get install gcc-multilib120 sudo apt-get install gcc-multilib
155 sudo apt-get install g++-multilib121 sudo apt-get install g++-multilib
156 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...122 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...
@@ -166,6 +132,37 @@ jobs:
166 run: |132 run: |
167 env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./...133 env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./...
168 134
135+ loong:
136+ strategy:
137+ matrix:
138+ # Loong64 support internal linking from go1.25.
139+ go: ['1.25.x']
140+ name: Test with Go ${{ matrix.go }} on Linux loong64
141+ runs-on: ubuntu-latest
142+ defaults:
143+ run:
144+ shell: bash
145+ steps:
146+ - uses: actions/checkout@v4
147+ - name: Setup Go
148+ uses: actions/setup-go@v5
149+ with:
150+ go-version: ${{ matrix.go }}
151+ - name: Set up the prerequisites
152+ run: |
153+ sudo apt-get update
154+ sudo apt-get install -y gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu qemu-user
155+ - name: go test (Linux loong64)
156+ run: |
157+ go env -w CC=loongarch64-linux-gnu-gcc-14
158+ go env -w CXX=loongarch64-linux-gnu-g++-14
159+ env GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
160+ env QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu qemu-loongarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
161+ env GOOS=linux GOARCH=loong64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
162+ env QEMU_LD_PREFIX=/usr/loongarch64-linux-gnu qemu-loongarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
163+ go env -u CC
164+ go env -u CXX
165+
169 bsd:166 bsd:
170 strategy:167 strategy:
171 matrix:168 matrix:

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close