mirror of
https://github.com/caddyserver/caddy.git
synced 2025-08-30 23:02:33 -04:00
ci: set proper build tags in golangci and minor cleanup (#7183)
* ci: set proper build tags in golangci and minor cleanup * clean * review --------- Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
1c596e3c5a
commit
493898d9bd
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@ -13,6 +13,7 @@ on:
|
|||||||
- 2.*
|
- 2.*
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
GOFLAGS: '-tags=nobadger,nomysql,nopgx'
|
||||||
# https://github.com/actions/setup-go/issues/491
|
# https://github.com/actions/setup-go/issues/491
|
||||||
GOTOOLCHAIN: local
|
GOTOOLCHAIN: local
|
||||||
|
|
||||||
@ -110,7 +111,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
run: |
|
run: |
|
||||||
go build -tags nobadger,nomysql,nopgx -trimpath -ldflags="-w -s" -v
|
go build -trimpath -ldflags="-w -s" -v
|
||||||
|
|
||||||
- name: Smoke test Caddy
|
- name: Smoke test Caddy
|
||||||
working-directory: ./cmd/caddy
|
working-directory: ./cmd/caddy
|
||||||
@ -133,7 +134,7 @@ jobs:
|
|||||||
# continue-on-error: true
|
# continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
# (go test -v -coverprofile=cover-profile.out -race ./... 2>&1) > test-results/test-result.out
|
# (go test -v -coverprofile=cover-profile.out -race ./... 2>&1) > test-results/test-result.out
|
||||||
go test -tags nobadger,nomysql,nopgx -v -coverprofile="cover-profile.out" -short -race ./...
|
go test -v -coverprofile="cover-profile.out" -short -race ./...
|
||||||
# echo "status=$?" >> $GITHUB_OUTPUT
|
# echo "status=$?" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Relevant step if we reinvestigate publishing test/coverage reports
|
# Relevant step if we reinvestigate publishing test/coverage reports
|
||||||
@ -190,7 +191,7 @@ jobs:
|
|||||||
retries=3
|
retries=3
|
||||||
exit_code=0
|
exit_code=0
|
||||||
while ((retries > 0)); do
|
while ((retries > 0)); do
|
||||||
CGO_ENABLED=0 go test -p 1 -tags nobadger,nomysql,nopgx -v ./...
|
CGO_ENABLED=0 go test -p 1 -v ./...
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
if ((exit_code == 0)); then
|
if ((exit_code == 0)); then
|
||||||
break
|
break
|
||||||
|
6
.github/workflows/cross-build.yml
vendored
6
.github/workflows/cross-build.yml
vendored
@ -11,6 +11,8 @@ on:
|
|||||||
- 2.*
|
- 2.*
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
GOFLAGS: '-tags=nobadger,nomysql,nopgx'
|
||||||
|
CGO_ENABLED: '0'
|
||||||
# https://github.com/actions/setup-go/issues/491
|
# https://github.com/actions/setup-go/issues/491
|
||||||
GOTOOLCHAIN: local
|
GOTOOLCHAIN: local
|
||||||
|
|
||||||
@ -74,11 +76,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Build
|
- name: Run Build
|
||||||
env:
|
env:
|
||||||
CGO_ENABLED: 0
|
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
GOARCH: ${{ matrix.goos == 'aix' && 'ppc64' || 'amd64' }}
|
GOARCH: ${{ matrix.goos == 'aix' && 'ppc64' || 'amd64' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
working-directory: ./cmd/caddy
|
working-directory: ./cmd/caddy
|
||||||
run: |
|
run: go build -trimpath -o caddy-"$GOOS"-$GOARCH 2> /dev/null
|
||||||
GOOS=$GOOS GOARCH=$GOARCH go build -tags=nobadger,nomysql,nopgx -trimpath -o caddy-"$GOOS"-$GOARCH 2> /dev/null
|
|
||||||
|
@ -2,6 +2,10 @@ version: "2"
|
|||||||
run:
|
run:
|
||||||
issues-exit-code: 1
|
issues-exit-code: 1
|
||||||
tests: false
|
tests: false
|
||||||
|
build-tags:
|
||||||
|
- nobadger
|
||||||
|
- nomysql
|
||||||
|
- nopgx
|
||||||
output:
|
output:
|
||||||
formats:
|
formats:
|
||||||
text:
|
text:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user