Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit e4bc060

Browse files
committed
Merge remote-tracking branch 'origin/next' into go-bump
2 parents 2685f97 + fabec7e commit e4bc060

File tree

5 files changed

+36
-8
lines changed

5 files changed

+36
-8
lines changed

.github/workflows/dispatch.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
push:
99
branches: [ master, testing ]
1010
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
1115

1216
env:
1317
# Number of repositories in a batch.

.github/workflows/release-check.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff 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

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ This check will be run in repositories that set `gogenerate` to `true` in `.gith
4343
Note that depending on the code generators used, it might be necessary to [install those first](#additional-setup-steps).
4444
The 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

4861
You can opt-in to receive early updates from the `next` branch in-between official Unified CI releases.

templates/.github/workflows/go-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
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:"

templates/.github/workflows/go-test.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
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:
@@ -34,6 +35,13 @@ jobs:
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
3846
uses: protocol/[email protected]
3947
with:
@@ -42,7 +50,7 @@ jobs:
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.
4654
uses: protocol/[email protected]
4755
env:
4856
GOARCH: 386

0 commit comments

Comments
 (0)