Skip to content

Commit

Permalink
🏗️ gh-actions: build & test with tfogo_checklinkname0 on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
database64128 committed Aug 16, 2024
1 parent c85ef57 commit b682a95
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
env CGO_ENABLED=0 GOAMD64=v2 go build -v -trimpath -ldflags '-s -w' -o package-linux-x86-64-v2/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOAMD64=v3 go build -v -trimpath -ldflags '-s -w' -o package-linux-x86-64-v3/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOARCH=arm64 go build -v -trimpath -ldflags '-s -w' -o package-linux-arm64/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOAMD64=v2 GOOS=windows go build -v -trimpath -ldflags '-s -w' -o package-windows-x86-64-v2/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOAMD64=v3 GOOS=windows go build -v -trimpath -ldflags '-s -w' -o package-windows-x86-64-v3/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -v -trimpath -ldflags '-s -w' -o package-windows-arm64/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOAMD64=v2 GOOS=windows go build -v -trimpath -ldflags '-s -w -checklinkname=0' -tags tfogo_checklinkname0 -o package-windows-x86-64-v2/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOAMD64=v3 GOOS=windows go build -v -trimpath -ldflags '-s -w -checklinkname=0' -tags tfogo_checklinkname0 -o package-windows-x86-64-v3/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -v -trimpath -ldflags '-s -w -checklinkname=0' -tags tfogo_checklinkname0 -o package-windows-arm64/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOAMD64=v3 GOOS=darwin go build -v -trimpath -ldflags '-s -w' -o package-macos-x86-64-v3/ ./cmd/shadowsocks-go
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -v -trimpath -ldflags '-s -w' -o package-macos-arm64/ ./cmd/shadowsocks-go
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,27 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version: stable

- name: Build
if: matrix.os != 'windows-latest'
run: |
go build -v -trimpath -ldflags '-s -w' ./cmd/shadowsocks-go
go build -v -trimpath -ldflags '-s -w' ./cmd/shadowsocks-go-domain-set-converter
- name: Build with tag tfogo_checklinkname0
if: matrix.os == 'windows-latest'
run: |
go build -v -trimpath -ldflags '-s -w -checklinkname=0' -tags tfogo_checklinkname0 ./cmd/shadowsocks-go
go build -v -trimpath -ldflags '-s -w -checklinkname=0' -tags tfogo_checklinkname0 ./cmd/shadowsocks-go-domain-set-converter
- name: Test
run: go test -v ./...

- name: Test with tag tfogo_checklinkname0
if: matrix.os == 'windows-latest'
run: go test -v -ldflags '-checklinkname=0' -tags tfogo_checklinkname0 ./...

- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test_gotip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version: stable

- name: Install gotip
run: |
go install golang.org/dl/gotip@latest
gotip download
- name: Build
if: matrix.os != 'windows-latest'
run: |
gotip build -v -trimpath -ldflags '-s -w' ./cmd/shadowsocks-go
gotip build -v -trimpath -ldflags '-s -w' ./cmd/shadowsocks-go-domain-set-converter
- name: Build with tag tfogo_checklinkname0
if: matrix.os == 'windows-latest'
run: |
gotip build -v -trimpath -ldflags '-s -w -checklinkname=0' -tags tfogo_checklinkname0 ./cmd/shadowsocks-go
gotip build -v -trimpath -ldflags '-s -w -checklinkname=0' -tags tfogo_checklinkname0 ./cmd/shadowsocks-go-domain-set-converter
Expand All @@ -34,6 +41,7 @@ jobs:
run: gotip test -v ./...

- name: Test with tag tfogo_checklinkname0
if: matrix.os == 'windows-latest'
run: gotip test -v -ldflags '-checklinkname=0' -tags tfogo_checklinkname0 ./...

- name: Upload Binaries
Expand Down

0 comments on commit b682a95

Please sign in to comment.