This repository was archived by the owner on Aug 29, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +36
-8
lines changed
templates/.github/workflows Expand file tree Collapse file tree 5 files changed +36
-8
lines changed Original file line number Diff line number Diff line change 88 push :
99 branches : [ master, testing ]
1010 workflow_dispatch :
11+
12+ concurrency :
13+ group : ${{ github.workflow }}-${{ github.ref }}
14+ cancel-in-progress : true
1115
1216env :
1317 # Number of repositories in a batch.
Original file line number Diff line number Diff line change @@ -60,13 +60,16 @@ jobs:
6060 run : |
6161 git fetch origin --tags
6262 go install github.com/marten-seemann/semver-highest@fcdc98f8820ff0e6613c1bee071c096febd98dbf
63- v=$(semver-highest -target "$VERSION" -versions $(git tag | paste -sd , -))
64- status=$?
65- if [[ $status != 0 ]]; then
66- echo $v
67- exit $status
63+ vs=$(git tag | paste -sd , -)
64+ if [[ ! -z "$vs" ]]; then
65+ v=$(semver-highest -target "$VERSION" -versions "$vs")
66+ status=$?
67+ if [[ $status != 0 ]]; then
68+ echo $v
69+ exit $status
70+ fi
71+ echo "version=$v" >> $GITHUB_ENV
6872 fi
69- echo "version=$v" >> $GITHUB_OUTPUT
7073 - name : Post output
7174 if : steps.tag.outputs.exists == 'false' && steps.prev.outputs.version == ''
7275 uses : marocchino/sticky-pull-request-comment@82e7a0d3c51217201b3fedc4ddde6632e969a477 # v2.1.1
Original file line number Diff line number Diff line change @@ -43,6 +43,19 @@ This check will be run in repositories that set `gogenerate` to `true` in `.gith
4343Note that depending on the code generators used, it might be necessary to [install those first](#additional-setup-steps).
4444The generators must also be deterministic, to prevent CI from getting different results each time.
4545
46+ ` go-test` offers an option to completely disable running 32-bit tests.
47+ This option is useful when a project or its upstream dependencies are not 32-bit compatible.
48+ Typically, such tests can be disabled using [build constraints](https://pkg.go.dev/cmd/go#hdr-Build_constraints).
49+ However, the constraints must be set per go file, which can be cumbersome for a project with many files.
50+ Using this option, 32-bit tests can be skipped entirely without having to specify build constraints per file.
51+
52+ To completely disable running 32-bit tests set `skip32bit` to `true` in `.github/workflows/go-test-config.json` :
53+ ` ` ` json
54+ {
55+ "skip32bit": true
56+ }
57+ ` ` `
58+
4659# # Technical Preview
4760
4861You can opt-in to receive early updates from the `next` branch in-between official Unified CI releases.
Original file line number Diff line number Diff line change 6161 with :
6262 run : |
6363 git clean -fd # make sure there aren't untracked files / directories
64- go generate ./...
64+ go generate -x ./...
6565 # check if go generate modified or added any files
6666 if ! $(git add . && git diff-index HEAD --exit-code --quiet); then
6767 echo "go generated caused changes to the repository:"
Original file line number Diff line number Diff line change 1010 go : ${{{ config.go.versions }}}
1111 env :
1212 COVERAGES : " "
13+ SKIP32BIT : false
1314 runs-on : ${{ format('{0}-latest', matrix.os) }}
1415 name : ${{ matrix.os }} (go ${{ matrix.go }})
1516 steps :
3435 - name : Run repo-specific setup
3536 uses : ./.github/actions/go-test-setup
3637 if : hashFiles('./.github/actions/go-test-setup') != ''
38+ - name : Read config
39+ if : hashFiles('./.github/workflows/go-test-config.json') != ''
40+ shell : bash
41+ run : |
42+ if jq -re .skip32bit ./.github/workflows/go-test-config.json; then
43+ echo "SKIP32BIT=true" >> $GITHUB_ENV
44+ fi
3745 - name : Run tests
38463947 with :
4250 # this means ./B's coverage will be significantly higher than 0%.
4351 run : go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./...
4452 - name : Run tests (32 bit)
45- if : ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
53+ if : matrix.os != 'macos' && env.SKIP32BIT == 'false' # can't run 32 bit tests on OSX.
46544755 env :
4856 GOARCH : 386
You can’t perform that action at this time.
0 commit comments