.github/workflows: add -e for FreeBSD test script and skip NetBSD tests (#306)
Without -e in the shebang #!/bin/sh, the script passed even some commands failed and then we missed some errors happened. This change adds -e to abort tests with an error code explicitly. As #305 says, FreeBSD tests w/o optimization fails. This change skips the test temporarilly. This change also retracts the support of NetBSD temporarily. Let's revert README again after #304 is fixed. Updates #304 Updates #305
- commit
- 1b61881350eafabf8a0a738f79723ca508a66eec
- author
- Hajime Hoshi · · 2025-03-17 18:19 UTC
- committer
- GitHub · · 2025-03-17 18:19 UTC
- parent
- 009f4b0
- signature
- GPG Unverified
B5690EEEBB952194The key is unknown
3 files · +9 -8
M .github/scripts/bsd_tests.sh +7 -5
| @@ -1,4 +1,4 @@ | |||
| 1 | - | #!/bin/sh | |
| 1 | + | #!/bin/sh -e | |
| 2 | 2 | ||
| 3 | 3 | # SPDX-License-Identifier: Apache-2.0 | |
| 4 | 4 | # SPDX-FileCopyrightText: 2025 The Ebitengine Authors | |
| @@ -69,11 +69,13 @@ env CGO_ENABLED=0 go test -gcflags="github.com/ebitengine/purego/internal/fakecg | |||
| 69 | 69 | echo "=> go test CGO_ENABLED=1" | |
| 70 | 70 | env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./... | |
| 71 | 71 | ||
| 72 | - | echo "=> go test CGO_ENABLED=0 w/o optimization" | |
| 73 | - | env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./... | |
| 72 | + | # TODO: Enable this test again (#305). | |
| 73 | + | # echo "=> go test CGO_ENABLED=0 w/o optimization" | |
| 74 | + | # env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./... | |
| 74 | 75 | ||
| 75 | - | echo "=> go test CGO_ENABLED=1 w/o optimization" | |
| 76 | - | env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./... | |
| 76 | + | # TODO: Enable this test again (#305). | |
| 77 | + | # echo "=> go test CGO_ENABLED=1 w/o optimization" | |
| 78 | + | # env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./... | |
| 77 | 79 | ||
| 78 | 80 | if [ -z "$(go version | grep '^1.1')" ]; then | |
| 79 | 81 | echo "=> go test race" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | #!/bin/sh | 1 | + | #!/bin/sh -e |
| 2 | 2 | ||||
| 3 | # SPDX-License-Identifier: Apache-2.0 | 3 | # SPDX-License-Identifier: Apache-2.0 | ||
| 4 | # SPDX-FileCopyrightText: 2025 The Ebitengine Authors | 4 | # SPDX-FileCopyrightText: 2025 The Ebitengine Authors | ||
| @@ -69,11 +69,13 @@ env CGO_ENABLED=0 go test -gcflags="github.com/ebitengine/purego/internal/fakecg | |||||
| 69 | echo "=> go test CGO_ENABLED=1" | 69 | echo "=> go test CGO_ENABLED=1" | ||
| 70 | env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./... | 70 | env CGO_ENABLED=1 go test -shuffle=on -v -count=10 ./... | ||
| 71 | 71 | ||||
| 72 | - | echo "=> go test CGO_ENABLED=0 w/o optimization" | 72 | + | # TODO: Enable this test again (#305). |
| 73 | - | env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./... | 73 | + | # echo "=> go test CGO_ENABLED=0 w/o optimization" |
| 74 | + | # env CGO_ENABLED=0 go test "-gcflags=all=-N -l" -v ./... | |||
| 74 | 75 | ||||
| 75 | - | echo "=> go test CGO_ENABLED=1 w/o optimization" | 76 | + | # TODO: Enable this test again (#305). |
| 76 | - | env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./... | 77 | + | # echo "=> go test CGO_ENABLED=1 w/o optimization" |
| 78 | + | # env CGO_ENABLED=1 go test "-gcflags=all=-N -l" -v ./... | |||
| 77 | 79 | ||||
| 78 | if [ -z "$(go version | grep '^1.1')" ]; then | 80 | if [ -z "$(go version | grep '^1.1')" ]; then | ||
| 79 | echo "=> go test race" | 81 | echo "=> go test race" | ||
M .github/workflows/test.yml +1 -1
| @@ -141,7 +141,7 @@ jobs: | |||
| 141 | 141 | bsd: | |
| 142 | 142 | strategy: | |
| 143 | 143 | matrix: | |
| 144 | - | os: ['FreeBSD', 'NetBSD'] | |
| 144 | + | os: ['FreeBSD'] # TODO: Add 'NetBSD' again (#304) | |
| 145 | 145 | go: ['1.18.10', '1.19.13', '1.20.14', '1.21.13', '1.22.12', '1.23.7', '1.24.1'] | |
| 146 | 146 | exclude: | |
| 147 | 147 | # there are no prebuilt download links for these versions of Go for NetBSD | |
| @@ -141,7 +141,7 @@ jobs: | |||||
| 141 | bsd: | 141 | bsd: | ||
| 142 | strategy: | 142 | strategy: | ||
| 143 | matrix: | 143 | matrix: | ||
| 144 | - | os: ['FreeBSD', 'NetBSD'] | 144 | + | os: ['FreeBSD'] # TODO: Add 'NetBSD' again (#304) |
| 145 | go: ['1.18.10', '1.19.13', '1.20.14', '1.21.13', '1.22.12', '1.23.7', '1.24.1'] | 145 | go: ['1.18.10', '1.19.13', '1.20.14', '1.21.13', '1.22.12', '1.23.7', '1.24.1'] | ||
| 146 | exclude: | 146 | exclude: | ||
| 147 | # there are no prebuilt download links for these versions of Go for NetBSD | 147 | # there are no prebuilt download links for these versions of Go for NetBSD | ||
M README.md +1 -2
| @@ -29,14 +29,13 @@ except for float arguments and return values. | |||
| 29 | 29 | - **FreeBSD**: amd64, arm64 | |
| 30 | 30 | - **Linux**: amd64, arm64 | |
| 31 | 31 | - **macOS / iOS**: amd64, arm64 | |
| 32 | - | - **NetBSD**: amd64, arm64 | |
| 33 | 32 | - **Windows**: 386*, amd64, arm*, arm64 | |
| 34 | 33 | ||
| 35 | 34 | `*` These architectures only support SyscallN and NewCallback | |
| 36 | 35 | ||
| 37 | 36 | ## Example | |
| 38 | 37 | ||
| 39 | - | The example below only showcases purego use for macOS, NetBSD and Linux. The other platforms require special handling which can | |
| 38 | + | The example below only showcases purego use for macOS, and Linux. The other platforms require special handling which can | |
| 40 | 39 | be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD. | |
| 41 | 40 | ||
| 42 | 41 | ```go | |
| @@ -29,14 +29,13 @@ except for float arguments and return values. | |||||
| 29 | - **FreeBSD**: amd64, arm64 | 29 | - **FreeBSD**: amd64, arm64 | ||
| 30 | - **Linux**: amd64, arm64 | 30 | - **Linux**: amd64, arm64 | ||
| 31 | - **macOS / iOS**: amd64, arm64 | 31 | - **macOS / iOS**: amd64, arm64 | ||
| 32 | - | - **NetBSD**: amd64, arm64 | |||
| 33 | - **Windows**: 386*, amd64, arm*, arm64 | 32 | - **Windows**: 386*, amd64, arm*, arm64 | ||
| 34 | 33 | ||||
| 35 | `*` These architectures only support SyscallN and NewCallback | 34 | `*` These architectures only support SyscallN and NewCallback | ||
| 36 | 35 | ||||
| 37 | ## Example | 36 | ## Example | ||
| 38 | 37 | ||||
| 39 | - | The example below only showcases purego use for macOS, NetBSD and Linux. The other platforms require special handling which can | 38 | + | The example below only showcases purego use for macOS, and Linux. The other platforms require special handling which can |
| 40 | be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD. | 39 | be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD. | ||
| 41 | 40 | ||||
| 42 | ```go | 41 | ```go | ||