detached 6aa09b6

.github/workflows: add tests for Linux arm64 (#167)

commit
6aa09b68c630e17af36c79122618372971b1e63d
author
Hajime Hoshi · · 2023-09-23 12:31 UTC
committer
GitHub · · 2023-09-23 12:31 UTC
parent
092d3a9
signature
GPG Unverified4AEE18F83AFDEB23 The key is unknown
2 files · +24 -2
M .github/workflows/test.yml +23 -1
@@ -1,6 +1,10 @@
11 name: Test
22
3-on: [push, pull_request]
3+on:
4+ pull_request:
5+ push:
6+ branches:
7+ - main
48
59 jobs:
610 test:
@@ -28,6 +32,12 @@ jobs:
2832 with:
2933 go-version: ${{ matrix.go }}
3034
35+ - name: Set up the prerequisites
36+ if: runner.os == 'Linux'
37+ run: |
38+ sudo apt-get update
39+ sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user
40+
3141 - name: go vet
3242 if: runner.os != 'Windows' && runner.os != 'macOS'
3343 run: |
@@ -82,6 +92,18 @@ jobs:
8292 env CGO_ENABLED=0 go test -shuffle=on -v -count=10 ./...
8393 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...
8494
95+ - name: go test (Linux arm64)
96+ if: runner.os == 'Linux'
97+ run: |
98+ go env -w CC=aarch64-linux-gnu-gcc
99+ go env -w CXX=aarch64-linux-gnu-g++
100+ env GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
101+ env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
102+ env GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
103+ env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
104+ go env -u CC
105+ go env -u CXX
106+
85107 # TODO: add Windows 386 tests
86108
87109 - name: go test race
@@ -1,6 +1,10 @@
1 name: Test1 name: Test
2 2
3-on: [push, pull_request]3+on:
4+ pull_request:
5+ push:
6+ branches:
7+ - main
4 8
5 jobs:9 jobs:
6 test:10 test:
@@ -28,6 +32,12 @@ jobs:
28 with:32 with:
29 go-version: ${{ matrix.go }}33 go-version: ${{ matrix.go }}
30 34
35+ - name: Set up the prerequisites
36+ if: runner.os == 'Linux'
37+ run: |
38+ sudo apt-get update
39+ sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user
40+
31 - name: go vet41 - name: go vet
32 if: runner.os != 'Windows' && runner.os != 'macOS'42 if: runner.os != 'Windows' && runner.os != 'macOS'
33 run: |43 run: |
@@ -82,6 +92,18 @@ jobs:
82 env CGO_ENABLED=0 go test -shuffle=on -v -count=10 ./...92 env CGO_ENABLED=0 go test -shuffle=on -v -count=10 ./...
83 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...93 env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...
84 94
95+ - name: go test (Linux arm64)
96+ if: runner.os == 'Linux'
97+ run: |
98+ go env -w CC=aarch64-linux-gnu-gcc
99+ go env -w CXX=aarch64-linux-gnu-g++
100+ env GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
101+ env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
102+ env GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
103+ env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
104+ go env -u CC
105+ go env -u CXX
106+
85 # TODO: add Windows 386 tests107 # TODO: add Windows 386 tests
86 108
87 - name: go test race109 - name: go test race
M callback_test.go +1 -1
@@ -14,7 +14,7 @@ import (
1414 "github.com/ebitengine/purego"
1515 )
1616
17-// TestCallGoFromSharedLib is a test that checks for stack corruption on darwin/arm64
17+// TestCallGoFromSharedLib is a test that checks for stack corruption on arm64
1818 // when C calls Go code from a non-Go thread in a dynamically loaded share library.
1919 func TestCallGoFromSharedLib(t *testing.T) {
2020 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")
@@ -14,7 +14,7 @@ import (
14 "github.com/ebitengine/purego"14 "github.com/ebitengine/purego"
15 )15 )
16 16
17-// TestCallGoFromSharedLib is a test that checks for stack corruption on darwin/arm6417+// TestCallGoFromSharedLib is a test that checks for stack corruption on arm64
18 // when C calls Go code from a non-Go thread in a dynamically loaded share library.18 // when C calls Go code from a non-Go thread in a dynamically loaded share library.
19 func TestCallGoFromSharedLib(t *testing.T) {19 func TestCallGoFromSharedLib(t *testing.T) {
20 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")20 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")

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