ci: proton native build (5 platforms) + HaE SDK JAR pipeline #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test | |
| on: | |
| push: | |
| branches: [master, main] | |
| pull_request: | |
| branches: [master, main] | |
| env: | |
| GONOSUMCHECK: "github.com/chainreactors/*" | |
| GONOSUMDB: "github.com/chainreactors/*" | |
| jobs: | |
| test: | |
| name: "Go 1.24" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24" | |
| - name: Build | |
| run: go build -v ./proton/file/ ./template/ | |
| - name: Test proton/file | |
| run: go test -v -count=1 -short -timeout 120s ./proton/file/ | |
| - name: Test template | |
| run: go test -v -count=1 -short -timeout 60s ./template/ | |
| test-cross-compile: | |
| name: "Cross Compile" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: windows | |
| goarch: amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| - goos: linux | |
| goarch: arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24" | |
| - name: Build | |
| run: CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v ./proton/file/ ./template/ | |
| test-legacy: | |
| name: "Go 1.17 (build-only)" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.17" | |
| - name: Build & Test proton/file | |
| run: | | |
| sed -i '/^toolchain /d' go.mod | |
| sed -i 's/^go .*/go 1.17/' go.mod | |
| rm proton/file/compat.go | |
| rm proton/file/*_test.go | |
| go mod edit -droprequire github.com/wasilibs/go-re2 | |
| go mod edit -droprequire github.com/tetratelabs/wazero | |
| go mod edit -droprequire github.com/wasilibs/wazero-helpers | |
| go mod edit -droprequire github.com/charlievieth/fastwalk | |
| go mod edit -droprequire github.com/chainreactors/fingers | |
| sed -i '/wasilibs/d; /wazero/d; /fastwalk/d; /chainreactors\/fingers/d' go.sum | |
| CGO_ENABLED=0 go build -v ./proton/file/ | |
| env: | |
| GOFLAGS: "-mod=mod" |