v0.8.4 a52bc83

test.yml RawHistoryFolder

1name: Test
2
3on: [push, pull_request]
4
5jobs:
6  test:
7    strategy:
8      matrix:
9        os: [ubuntu-latest, macos-latest, windows-latest]
10        go: ['1.18.x', '1.19.x', '1.20.x', '1.21.x', '1.22.x', '1.23.x']
11    name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
12    runs-on: ${{ matrix.os }}
13    defaults:
14      run:
15        shell: bash
16    steps:
17      - name: Git
18        run: |
19          # See actions/checkout#135
20          git config --global core.autocrlf false
21          git config --global core.eol lf
22
23      - name: Checkout
24        uses: actions/checkout@v4
25
26      - name: Setup Go
27        uses: actions/setup-go@v5
28        with:
29          go-version: ${{ matrix.go }}
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 qemu-user
36
37      - name: go vet
38        if: runner.os != 'Windows' && runner.os != 'macOS'
39        run: |
40          go vet -v ./...
41
42      - name: go build
43        run: |
44          go build -v ./...
45          # Compile without optimization to check potential stack overflow.
46          # The option '-gcflags=all=-N -l' is often used at Visual Studio Code.
47          # See also https://go.googlesource.com/vscode-go/+/HEAD/docs/debugging.md#launch and the issue hajimehoshi/ebiten#2120.
48          go build "-gcflags=all=-N -l" -v ./...
49
50          # Check cross-compiling Windows binaries.
51          env GOOS=windows GOARCH=386 go build -v ./...
52          env GOOS=windows GOARCH=amd64 go build -v ./...
53          env GOOS=windows GOARCH=arm go build -v ./...
54          env GOOS=windows GOARCH=arm64 go build -v ./...
55
56          # Check cross-compiling macOS binaries.
57          env GOOS=darwin GOARCH=amd64 go build -v ./...
58          env GOOS=darwin GOARCH=arm64 go build -v ./...
59
60          # Check cross-compiling Linux binaries.
61          env GOOS=linux GOARCH=amd64 go build -v ./...
62          env GOOS=linux GOARCH=arm64 go build -v ./...
63
64          # Check cross-compiling FreeBSD binaries.
65          # gcflags -std is necessary to make fakecgo the Cgo for
66          # FreeBSD to add the symbols that libc.so depends on.
67          env GOOS=freebsd GOARCH=amd64 go build -gcflags="github.com/ebitengine/purego/internal/fakecgo=-std" -v ./...
68          env GOOS=freebsd GOARCH=arm64 go build -gcflags="github.com/ebitengine/purego/internal/fakecgo=-std" -v ./...
69
70      - name: go build (plugin)
71        if: runner.os == 'Linux' || runner.os == 'macOS'
72        run:
73          # Make sure that plugin buildmode works since we save the R15 register (#254)
74          go build -buildmode=plugin ./examples/libc
75
76      - name: go mod vendor
77        if: runner.os != 'Linux'
78        run: |
79          mkdir /tmp/vendoring
80          cd /tmp/vendoring
81          go mod init foo
82          echo 'package main' > main.go
83          echo 'import (' >> main.go
84          echo '  _ "github.com/ebitengine/purego"' >> main.go
85          echo ')' >> main.go
86          echo 'func main() {}' >> main.go
87          go mod edit -replace github.com/ebitengine/purego=$GITHUB_WORKSPACE
88          go mod tidy
89          go mod vendor
90          go build -v .
91
92      - name: go test
93        run: |
94          env CGO_ENABLED=0 go test -shuffle=on -v -count=10 ./...
95          env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...
96          # Compile without optimization to check potential stack overflow.
97          # The option '-gcflags=all=-N -l' is often used at Visual Studio Code.
98          # See also https://go.googlesource.com/vscode-go/+/HEAD/docs/debugging.md#launch.
99          env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./...
100          env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./...
101
102      - name: go test (Linux arm64)
103        if: runner.os == 'Linux'
104        run: |
105          go env -w CC=aarch64-linux-gnu-gcc
106          go env -w CXX=aarch64-linux-gnu-g++
107          env GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go test -c -o=purego-test-nocgo .
108          env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-nocgo -test.shuffle=on -test.v -test.count=10
109          env GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go test -c -o=purego-test-cgo .
110          env QEMU_LD_PREFIX=/usr/aarch64-linux-gnu qemu-aarch64 ./purego-test-cgo -test.shuffle=on -test.v -test.count=10
111          
112          echo "=> go build (plugin)"
113          # Make sure that plugin buildmode works since we save the R15 register (#254)
114          env GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build -buildmode=plugin ./examples/libc
115          
116          go env -u CC
117          go env -u CXX
118
119      - name: go test (Windows 386)
120        if: runner.os == 'Windows'
121        run: |
122          env CGO_ENABLED=0 GOARCH=386 go test -shuffle=on -v -count=10 ./...
123          env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...
124
125      - name: go test (Linux 386)
126        if: runner.os == 'Linux'
127        run: |
128           sudo apt-get install gcc-multilib
129           sudo apt-get install g++-multilib
130           env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...
131
132      - name: go test race (no Cgo)
133        if: ${{ runner.os == 'macOS' &&  !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') }}
134        run: |
135          # -race usually requires Cgo, but macOS is an exception. See https://go.dev/doc/articles/race_detector#Requirements
136          env CGO_ENABLED=0 go test -race -shuffle=on -v -count=10 ./...
137
138      - name: go test race (Cgo)
139        if: ${{ !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') }}
140        run: |
141          env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./...
142
143  freebsd:
144    strategy:
145      matrix:
146        go: ['1.18.10', '1.19.13', '1.20.14', '1.21.13', '1.22.12', '1.23.9', '1.24.3']
147    name: Test with Go ${{ matrix.go }} on FreeBSD
148    runs-on: ubuntu-22.04
149    defaults:
150      run:
151        shell: bash
152    steps:
153      - uses: actions/checkout@v4
154      - name: Run in freebsd
155        uses: vmactions/freebsd-vm@v1
156        with:
157          usesh: true
158          prepare: |
159            fetch https://go.dev/dl/go${{matrix.go}}.freebsd-amd64.tar.gz
160            rm -fr /usr/local/go && tar -C /usr/local -xf go${{matrix.go}}.freebsd-amd64.tar.gz
161            ln -s /usr/local/go/bin/go /usr/local/bin
162          run: |
163            # FreeBSD tests run within QEMU on Ubuntu.
164            # vmactions/freebsd-vm only supports a single "step" where it
165            # brings down the VM at the end of the step, so all
166            # the commands to run need to be put into this single block.
167
168            echo "Running tests on $(uname -a) at $PWD"
169
170            # verify Go is available
171            go version
172
173            echo "=> go build"
174            go build -v ./...
175            # Compile without optimization to check potential stack overflow.
176            # The option '-gcflags=all=-N -l' is often used at Visual Studio Code.
177            # See also https://go.googlesource.com/vscode-go/+/HEAD/docs/debugging.md#launch and the issue hajimehoshi/ebiten#2120.
178            go build "-gcflags=all=-N -l" -v ./...
179
180            # Check cross-compiling Windows binaries.
181            env GOOS=windows GOARCH=386 go build -v ./...
182            env GOOS=windows GOARCH=amd64 go build -v ./...
183            env GOOS=windows GOARCH=arm go build -v ./...
184            env GOOS=windows GOARCH=arm64 go build -v ./...
185
186            # Check cross-compiling macOS binaries.
187            env GOOS=darwin GOARCH=amd64 go build -v ./...
188            env GOOS=darwin GOARCH=arm64 go build -v ./...
189
190            # Check cross-compiling Linux binaries.
191            env GOOS=linux GOARCH=amd64 go build -v ./...
192            env GOOS=linux GOARCH=arm64 go build -v ./...
193
194            # Check cross-compiling FreeBSD binaries.
195            env GOOS=freebsd GOARCH=amd64 go build -gcflags="github.com/ebitengine/purego/internal/fakecgo=-std" -v ./...
196            env GOOS=freebsd GOARCH=arm64 go build -gcflags="github.com/ebitengine/purego/internal/fakecgo=-std" -v ./...
197
198            echo "=> go build (plugin)"
199            # Make sure that plugin buildmode works since we save the R15 register (#254)
200            go build -buildmode=plugin ./examples/libc
201
202            echo "=> go mod vendor"
203            mkdir /tmp/vendoring
204            cd /tmp/vendoring
205            go mod init foo
206            echo 'package main' > main.go
207            echo 'import (' >> main.go
208            echo '  _ "github.com/ebitengine/purego"' >> main.go
209            echo ')' >> main.go
210            echo 'func main() {}' >> main.go
211            go mod edit -replace github.com/ebitengine/purego=$GITHUB_WORKSPACE
212            go mod tidy
213            go mod vendor
214            go build -v .
215
216            cd $GITHUB_WORKSPACE
217            echo "=> go test CGO_ENABLED=0"
218            env CGO_ENABLED=0 go test -gcflags="github.com/ebitengine/purego/internal/fakecgo=-std" -shuffle=on -v -count=10 ./...
219
220            echo "=> go test CGO_ENABLED=1"
221            env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./...
222
223            if [ -z "$(echo ${{matrix.go}} | grep '^1.1')" ]; then
224              echo "=> go test race"
225              go test -race -shuffle=on -v -count=10 ./...
226            fi

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