Commit graph

59 commits

Author SHA1 Message Date
Alisdair McDiarmid
1317cda8e7 build: Run checks on all pushed branches
It is helpful to see the result of the checks workflow prior to opening
a PR, to avoid wasting time fixing unexpectedly failing checks while the
PR is open and awaiting review. This commit configures GitHub Actions to
run checks on all pushed branches.
2024-02-23 11:53:34 -05:00
Radek Simko
0c509183d1
ci: Add test for license headers (#34624)
* ci: Add test for copyright headers

* replace GHA workflow with make target (copyright)

This makes it reusable for outside of CI, such that anyone cloning the repo locally can still easily verify compliance before raising a PR.

* remove go:generate for copywrite

This should no longer be needed as we leverage copywrite via a shell script now.

* introduce make copyrightfix
2024-02-14 07:53:39 +00:00
Craig Wright
5848d8a2b4
Limiting lock behavior to issues and PRs; ignoring discussions.
Currently, discussions are not a feature we use on GitHub. However, we did not want to enable an automated behavior that would be difficult and confusing to track down for a future enabler of GitHub Discussions.
2023-12-06 15:48:12 -08:00
kyu08
9e12056cfb chore(GitHub Actions): fix inputs of Lock Threads, and bump version 2023-12-05 22:59:56 +09:00
CJ Horton
617fb35ad1
pin the image sha for good measure 2023-09-21 10:37:11 -07:00
CJ Horton
49eba459f1
use latest backport-assistant 2023-09-21 10:15:24 -07:00
Liam Cervante
9d330d2b0a
Fix cross build file link from build.yml (#33735) 2023-08-24 16:55:40 +02:00
Rose M Koron
cfc26c3e21 Update file name 2023-08-16 16:24:31 -07:00
sarahethompson
633f6a6528
update linux package license to BUSL-1.1
update copywrite.hcl to BUS-1.1
2023-08-14 11:13:37 +01:00
hashicorp-tsccr[bot]
4671514676
Result of tsccr-helper -log-level=info -pin-all-workflows . (#33527)
Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com>
2023-07-14 18:02:38 +01:00
Bryce Kalow
c42e0ee89c
chore(docs): delete check-legacy-links-format.yml (#33300) 2023-06-01 09:31:06 -05:00
Scott Macfarlane
fa3980b77d
Disable reproducability check in actions-go-build (#33095)
Signed-off-by: Scott Macfarlane <smacfarlane@hashicorp.com>
2023-04-26 19:42:00 +01:00
Liam Cervante
1a36d07ead
Add new actions for executing the equivalence tests after a CRT release (#32959)
* add new actions for executing the equivalence tests after a CRT release

* ready for review

* Update .github/actions/equivalence-test/action.yml

Co-authored-by: CJ Horton <17039873+radditude@users.noreply.github.com>

* address comments

---------

Co-authored-by: CJ Horton <17039873+radditude@users.noreply.github.com>
2023-04-17 10:51:04 +02:00
Daniel Kimsey
1d9581682b ci: Smoke test docker builds
This adds a test to catch the glibc build issue that caused #32947. We check
both the container executes and the version is correct.
2023-04-05 12:32:27 -05:00
Daniel Kimsey
64c4e1b4c1
Merge pull request #32951 from hashicorp/fix-incorrect-cgo-flag
ci: Correctly pass cgo_enabled=0 flag
2023-03-30 13:45:02 -05:00
Daniel Kimsey
e9628c5eba
ci: Correctly pass cgo_enabled=0 flag
This flag was not being passed correctly, it caused the value to be read as unset. Which effectively defaults to enabled.

Related to incident 230330-1
2023-03-30 13:38:50 -05:00
emily neil
649d6d3f12
Upload ECR image to correct ECR repo (#32948)
Co-authored-by: emilymianeil <eneil@hashicorp.com>
2023-03-30 11:38:02 -07:00
emily neil
880b87a0e7
Releng/migrate common release tooling (#32797)
* Migrate set-output to GITHUB_OUTPUT

Signed-off-by: Scott Macfarlane <smacfarlane@hashicorp.com>

* Migrate terraform to CRT

* Update ci branches & ci notification channel

* Use version/VERSION file to parse version

* Remove fetch raw version script and update pipeline to run on current branch

* PR feedback: cgo-enabled now required flag, updated comments & include promotion steps in ci.hcl

* Update version for main

---------

Signed-off-by: Scott Macfarlane <smacfarlane@hashicorp.com>
Co-authored-by: Scott Macfarlane <smacfarlane@hashicorp.com>
Co-authored-by: emilymianeil <eneil@hashicorp.com>
2023-03-28 10:39:37 -07:00
Ashlee M Boyer
b431b4ab80
Update check-legacy-links-format.yml 2023-03-09 13:12:27 -05:00
Ashlee M Boyer
e793729602
Delete test-link-rewrites.yml 2023-03-06 15:25:37 -05:00
Ashlee Boyer
c850399c0d Updating main-branch-preview-url 2023-02-23 12:57:23 -05:00
Ashlee Boyer
534366d0ff Adding test-link-rewrites workflow 2023-02-23 12:04:12 -05:00
Ashlee Boyer
e81c849617 Adding docs-content-check-legacy-links-format workflow 2023-02-23 12:04:12 -05:00
CJ Horton
25d8f26e41
Remove docs bundle from build workflow 2023-02-17 19:56:45 -08:00
Liam Cervante
6a1a9928a2
[equivalence tests] Use the latest equivalence testing version when executing equivalence tests. (#32659) 2023-02-13 15:40:02 +01:00
Liam Cervante
2325ec716c
Update Terraform equivalence tests to remove unneeded input. (#32288)
* test

* update equivalence testing framework version

* Remove debugging statements

* remove more debugging statements

* s/liamcervante/hashicorp/g

* remove and update deprecated set-output statements
2022-12-02 11:22:02 +01:00
Liam Cervante
37b88b33ce
Rollout equivalence testing during Terraform releases and builds (#31928)
* add some basic equivalence tests and execute them in the build pipeline

* remove old file, now unused

* update terraform-equivalence-testing to v0.2.0

* add separate action

* make sure to read from hashicorp repo

* remove elevated github token where possible

* Don't need elevated token anymore

* update with official mock provider

* last change: don't need the authorization header for public repositories.
2022-11-24 14:00:08 +01:00
Liam Cervante
4d7ba14f72
Add skeleton action for equivalence tests (#31940) 2022-10-06 12:11:27 +02:00
Martin Atkins
d735de3656 build: checks.yml GitHub Actions workflow doesn't need goimports installed
The importscheck script now uses "go run" to run this program and so
the Go toolchain will install it automatically using the version number
of golang.org/x/tools specified in our go.mod file.
2022-08-26 09:47:30 -07:00
Alvin Huang
634c875bea set PRODUCT_VERSION for default docker build 2022-08-18 12:50:41 -04:00
Liam Cervante
afd273d636
Add goimports as a check to the Github commit actions (#31432)
* Add goimports as a check to the Github commit actions

* check diff against main instead of last commit

* goimports should fix the problems

* fix up conditionals and wildcard matching

* specify origin/main in diff

* fetch main branch when checkout

* back to origin main
2022-07-19 10:14:28 +01:00
Martin Atkins
284a38a04c build: Accept version numbers with prereleases containing dashes
Previously we'd discard everything after the second dash.
2022-05-23 16:48:34 -07:00
Martin Atkins
096f0dc0da build: Write the detected version number into the generated executable
This also sets an additional variable if it detects that this is an alpha
or development build, which currently does nothing but might eventually
turn on the ability to use experimental features, if we make that
something available only in prereleases.
2022-05-23 16:48:34 -07:00
Martin Atkins
7dd3cdfab4 build: Fetch all tags before deciding which version we're building
The actions/checkout workflow does some heroics to try to fetch exactly
the commit being built and nothing else, even if asked to fetch the
history leading up to that commit. That means we don't end up having
enough information to get an accurate answer from "git describe".

Since we're intentionally relying on the git history here, we'll fetch
all of the tags explicitly after initial checkout. Although that does add
some delay to this step, we're intentionally doing this version
calculation only once as a separate workflow job so that all of the other
jobs can still benefit from this action's quicker checkout behavior.
2022-05-23 16:48:34 -07:00
James Bardin
2bd72914d8 add internal/states to the race detector tests
This runs relatively quickly, and there is at least 1 test with
concurrent operations.
2022-04-28 11:44:32 -04:00
Claire Labry
dd2decf921
change action to pull v1 instead of main 2022-04-22 13:54:40 -04:00
James Bardin
0693c8dfe7 enable the race detector in tests 2022-04-20 16:32:39 -04:00
Martin Atkins
5b615882e2
build: "Quick Checks" to run for external contributions
The "push" event is only for pushes to branches within the same repository.

Since external contributors make commits in their own repositories rather than directly in the target repository, we also need the pull_request event to react to opening a pull request and to pushing new code to an external branch associated with a pull request.

Since internal pull requests would in principle trigger both "push" _and_ "pull_request", we also constrain the push event only to the branches we typically release from, on the assumption that all other branches will merge into those via pull requests. This avoids redundantly running the same checks in response to two events at the same time.
2022-04-07 17:00:44 -07:00
Martin Atkins
bbf540e0e3 build: "Quick Checks" caches protoc between runs
Building our protobuf files requires the protoc tool, which takes a little
while to download and install. Hopefully downloading it out of the GitHub
Actions cache will make it a little faster in the common case where we're
still using the same version as the previous run.
2022-04-04 08:12:44 -07:00
Martin Atkins
42a618f7c1 build: "Quick Checks" runs consistency checks concurrently with others
Originally we had this running as part of the Unit Tests job because most
of the checks are relatively fast. However, the addition of the protobuf
generation check made that no longer be true because it needs to download
and run protoc.

With that extra overhead it now _is_ productive to spend the time booting
and installing Go on third worker, as long as GitHub Actions continues
to let us run all three of these jobs concurrently most of the time.
2022-04-04 08:12:44 -07:00
Martin Atkins
95f26b340b build: "Quick Checks" no longer uses goenv
goenv was making things more complicated than needed since it's really
designed to help with interactive use in a shell more than automated use
like this.

Instead, we'll follow the same strategy that our build.yml was doing of
just reading the .go-version file directly and then using the official
actions/setup-go action to do the actual installation. The key advantage
here is that Go ends up installed in a way where just running "go" will
do the right thing, and we no longer need to fuss with shims and
version-based path prefixes.

Rather than duplicating the logic from build.yml, instead it's factored
out into a separate composite action which both build.yml and checks.yml
will now share, in case we want to change the Go version selection
methodology in the future.
2022-04-04 08:12:44 -07:00
Martin Atkins
67fedd48a6 build: "Quick Checks" avoid repeating Install Go
This factors out the "Install Go" step into a separate composite action
which we can then call from both of the jobs that need it.

We can't factor out the "Cache Go Modules" because GitHub doesn't allow
composite actions to refer to other external actions.
2022-04-04 08:12:44 -07:00
Martin Atkins
9210ce6cdd build: GitHub Actions "Quick Checks" workflow
This is intended to eventually replace the CircleCI-based checks we use
as part of the PR process in this repository. We're already using GitHub
Actions for various other processes in this repository, so this change is
motivated by consistency of having all of our automation running in the
same system and written in the same language.

This is not a complete replacement for our CircleCI workflow yet, and
probably won't ever be because the CircleCI workflow contains some steps
that are arguably redundant with other processes we follow elsewhere.
However, the CircleCI workflow remains for now and won't be removed until
we're satisfied that enough of it is replicated by this GitHub Actions
workflow.
2022-04-04 08:12:44 -07:00
Alisdair McDiarmid
636499830b Add merged pull request reminder 2022-01-26 15:52:54 -05:00
Michele Degges
2f465e6047 Update packaging action name 2022-01-20 13:15:19 -08:00
Martin Atkins
4ec1feaa3d build: CGO_ENABLED when building for macOS
Normally when we cross-compile we do so without CGo, because we don't have
suitable C headers available for systems other than the host.

However, building for macOS on macOS is special because there are
sufficient headers available on darwin_amd64 to build for both
darwin_amd64 _and_ darwin_arm64. Also, we _must_ use CGo on macOS because
the system resolver is only available via darwin's libc, and so building
without CGo produces executables that don't resolve hostnames correctly.

This is a conditional in bash to avoid having to duplicate the entire
step. Perhaps later we'll find a more general version of this which can
avoid the special case, but this is sufficient for the moment.
2022-01-06 14:51:09 -08:00
Martin Atkins
28a6036cf2 build: Separate Linux distro package builds into separate job
In our build workflow we'll treat Linux distribution packaging (currently
.deb and .rpm packages) as a separate job, instead of embedding it into
the "build" job, so that this step can happen concurrently with the other
derived actions like the docker image build, and the e2etest runs.
2022-01-05 14:31:04 -08:00
Martin Atkins
c1699ea80c build: Constrain permissions for the "build" workflow steps
This workflow only generates artifacts and doesn't need to modify anything
about the repository.
2022-01-05 14:31:04 -08:00
Martin Atkins
3bf758eaf5 build: Consolidate build-darwin job into just "build"
We can use an extra matrix dimension to select which execution environment
we'll use for each GOOS/GOARCH pair, and thus avoid duplicating the
job definition for darwin just to set runs-on: macos-latest for it.

This is not really an intended use of a matrix dimension because it's
directly related to the existing "goos" one, rather than being an
independent third dimension, but it doesn't matter in practice because
we're using the "include" option to specify exact combinations, and thus
we're not relying on the built-in functionality to generate all possible
matrix combinations.
2022-01-05 14:31:04 -08:00
Martin Atkins
218e55b23c build: Build docs source package as part of the release pipeline
This should eventually grow to be a step that actually verifies the
validity of the docs source prior to publishing the artifact that a
downstream publishing pipeline can consume, but for the moment it's really
just a placeholder since we have no such validation step and no downstream
pipeline consuming this artifact.

The general idea here is that the artifacts from this workflow should be
sufficient for all downstream release steps to occur without any direct
access to the Terraform CLI repository, and so this is intended to
eventually meet that ideal but as of this commit the website docs
publishing step _does_ still depend on direct access to this repository.
2022-01-05 14:31:04 -08:00