-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Use GH actions to expand OS test matrix (#174)
Expand testing to all OS versions available on GitHub actions (macos-{11,12,13} on amd64, ubuntu-{20.04,22.04}, windows-{2019,2022}). Jenkins will remain for testing on macOS on arm64 and ubuntu-18. Add github workflow to generate releases with release notes. There is no more CHANGELOG.md. Instead there is a tool used to generate the release notes from individual changelog entries found in `.changelog/{pr_number}.txt`. Replace goimports and golint with a roughly equivalent golangci-lint configuration. This will be expanded to be more thorough in a separate change. Add check that go.mod is tidy. Add CONTRIBUTING.md.
- Loading branch information
1 parent
c0d4d10
commit 451c7aa
Showing
17 changed files
with
308 additions
and
391 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
darwin: Prevent possible runtime panic while reading process arguments. | ||
``` |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{- if .NotesByType.note -}} | ||
NOTES: | ||
{{range .NotesByType.note -}} | ||
* {{ template "note" .}} | ||
{{ end -}} | ||
{{- end -}} | ||
|
||
{{- if .NotesByType.deprecation -}} | ||
DEPRECATIONS: | ||
{{range .NotesByType.deprecation -}} | ||
* {{ template "note" .}} | ||
{{ end -}} | ||
{{- end -}} | ||
|
||
{{- if index .NotesByType "breaking-change" -}} | ||
BREAKING CHANGES: | ||
{{range index .NotesByType "breaking-change" -}} | ||
* {{ template "note" .}} | ||
{{ end -}} | ||
{{- end -}} | ||
|
||
{{- $features := combineTypes .NotesByType.feature (index .NotesByType "new-resource" ) (index .NotesByType "new-datasource") (index .NotesByType "new-data-source") -}} | ||
{{- if $features }} | ||
FEATURES: | ||
{{range $features | sort -}} | ||
* {{ template "note" . }} | ||
{{ end -}} | ||
{{- end -}} | ||
|
||
{{- $improvements := combineTypes .NotesByType.improvement .NotesByType.enhancement -}} | ||
{{- if $improvements }} | ||
IMPROVEMENTS: | ||
{{range $improvements | sort -}} | ||
* {{ template "note" . }} | ||
{{ end -}} | ||
{{- end -}} | ||
|
||
{{- if .NotesByType.bug }} | ||
BUG FIXES: | ||
{{range .NotesByType.bug -}} | ||
* {{ template "note" . }} | ||
{{ end -}} | ||
{{- end -}} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{- define "note" -}} | ||
{{if eq "new-resource" .Type}}**New Resource:** {{else if eq "new-datasource" .Type}}**New Data Source:** {{ end }}{{.Body}} ([GH-{{- .Issue -}}]) | ||
{{- end -}} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
set -uo pipefail | ||
|
||
if [[ -z "${PR_NUMBER}" ]]; then | ||
echo "PR_NUMBER must be set." | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${BASE_REF}" ]]; then | ||
echo "BASE_REF must be set." | ||
exit 1 | ||
fi | ||
|
||
docs_url="https://github.com/GoogleCloudPlatform/magic-modules/blob/2834761fec3acbf35cacbffe100530f82eada650/.ci/RELEASE_NOTES_GUIDE.md#expected-format" | ||
|
||
# Version of https://github.com/hashicorp/go-changelog. | ||
go_changelog_version=ba40b3a | ||
go_changelog_check="go run github.com/hashicorp/go-changelog/cmd/changelog-check@${go_changelog_version}" | ||
|
||
expected_changelog_file=.changelog/${PR_NUMBER}.txt | ||
|
||
# Verify file is present. | ||
if [ ! -e "${expected_changelog_file}" ]; then | ||
echo "Changelog file missing at ${expected_changelog_file}. | ||
Please add a changelog entry following the format described [here](${docs_url}). | ||
If this change does not require a changelog entry then label the pull request | ||
with skip-changelog. | ||
" >> $GITHUB_STEP_SUMMARY | ||
exit 1 | ||
fi | ||
|
||
# Check the format. | ||
if ! ${go_changelog_check} "${expected_changelog_file}"; then | ||
echo "Changelog format is invalid. See build log." >> $GITHUB_STEP_SUMMARY | ||
exit 1 | ||
fi | ||
|
||
echo "Changelog is valid." >> $GITHUB_STEP_SUMMARY |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -xeuo pipefail | ||
|
||
export CGO_ENABLED=0 | ||
|
||
# Test that there are no compilation issues when not using CGO. This does | ||
# not imply that all of these targets are supported without CGO. It's only | ||
# a sanity check for build tag issues. | ||
GOOS=aix GOARCH=ppc64 go build ./... | ||
GOOS=darwin GOARCH=amd64 go build ./... | ||
GOOS=darwin GOARCH=arm64 go build ./... | ||
GOOS=linux GOARCH=386 go build ./... | ||
GOOS=linux GOARCH=amd64 go build ./... | ||
GOOS=linux GOARCH=arm go build ./... | ||
GOOS=linux GOARCH=arm64 go build ./... | ||
GOOS=linux GOARCH=mips go build ./... | ||
GOOS=linux GOARCH=mips64 go build ./... | ||
GOOS=linux GOARCH=mips64le go build ./... | ||
GOOS=linux GOARCH=mipsle go build ./... | ||
GOOS=linux GOARCH=ppc64 go build ./... | ||
GOOS=linux GOARCH=ppc64le go build ./... | ||
GOOS=linux GOARCH=riscv64 go build ./... | ||
GOOS=linux GOARCH=s390x go build ./... | ||
GOOS=windows GOARCH=amd64 go build ./... | ||
GOOS=windows GOARCH=arm go build ./... | ||
GOOS=windows GOARCH=arm64 go build ./... |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
go install github.com/elastic/go-licenser@latest | ||
go install gotest.tools/gotestsum@latest | ||
|
||
go mod verify | ||
go-licenser -d | ||
go run .ci/scripts/check_format.go | ||
go run .ci/scripts/check_lint.go | ||
|
||
mkdir -p build | ||
SET OUT_FILE=build\output-report.out | ||
gotestsum --format testname --junitfile build\junit-%GO_VERSION%.xml -- ./... |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: changelog | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, labeled, unlabeled] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check: | ||
if: "!contains(github.event.pull_request.labels.*.name, 'skip-changelog')" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: changelog | ||
env: | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
BASE_REF: ${{ github.event.pull_request.base.ref }} | ||
run: .ci/scripts/check-changelog.sh |
Oops, something went wrong.