-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automated testing GHA specific to the version package
- Loading branch information
1 parent
4484658
commit 89b052e
Showing
1 changed file
with
61 additions
and
0 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,61 @@ | ||
# This workflow is intended to run on PRs for preparing a new release. Those PRs may | ||
# contain diffs for only the CHANGELOG and version/VERSION files, so we skip running | ||
# the complete set of 'Quick Checks'. Instead we only run the tests present in the | ||
# version package. This ensures that edits to the version/VERSION file are valid. | ||
name: Check version package | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- opened | ||
- ready_for_review | ||
- reopened | ||
- synchronize | ||
paths: | ||
- 'version/**' | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+*' | ||
paths: | ||
- 'version/**' | ||
|
||
|
||
permissions: | ||
contents: read | ||
|
||
|
||
jobs: | ||
check-version-package: | ||
name: "Check version/VERSION value" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Fetch source code" | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- name: Determine Go version | ||
id: go | ||
uses: ./.github/actions/go-version | ||
|
||
- name: Install Go toolchain | ||
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | ||
with: | ||
go-version: ${{ steps.go.outputs.version }} | ||
|
||
# NOTE: This cache is shared so the following step must always be | ||
# identical across the unit-tests, e2e-tests, and consistency-checks | ||
# jobs, or else weird things could happen. | ||
- name: Cache Go modules | ||
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | ||
with: | ||
path: "~/go/pkg" | ||
key: go-mod-${{ hashFiles('go.sum') }} | ||
restore-keys: | | ||
go-mod- | ||
- name: "Test version package" | ||
run: | | ||
go test -v github.com/hashicorp/terraform/version |