Commit Graph

17 Commits

Author SHA1 Message Date
Seth Vargo 449913e655
Update go.yml 2021-03-11 13:25:04 -05:00
Seth Vargo ddc69a1638
Improve Actions hygiene
👋 hello there! I'm a fellow Googler who works on projects that leverage GitHub Actions for CI/CD. Recently I noticed a large increase in our queue time, and I've tracked it down to the [limit of 180 concurrent jobs](https://docs.github.com/en/actions/reference/usage-limits-billing-and-administration) for an organization. To help be better citizens, I'm proposing changes across a few repositories that will reduce GitHub Actions hours and consumption. I hope these changes are reasonable and I'm happy to talk through them in more detail.

- (**you were already doing this, thank you!**) Only run GitHub Actions for pushes and PRs against the main branch of the repository. If your team uses a forking model, this change will not affect you. If your team pushes branches to the repository directly, this changes actions to only run against the primary branches or if you open a Pull Request against a primary branch.

- For long-running jobs (especially tests), I added the "Cancel previous" workflow. This is very helpful to prevent a large queue backlog when you are doing rapid development and pushing multiple commits. Without this, GitHub Actions' default behavior is to run all actions on all commits.

There are other changes you could make, depending on your project (but I'm not an expert):

- If you have tests that should only run when a subset of code changes, consider gating your workflow to particular file paths. For example, we have some jobs that do Terraform linting, but [they only run when Terraform files are changed](c4f59fee71/.github/workflows/terraform.yml (L3-L11)).

Hopefully these changes are not too controversial and also hopefully you can see how this would reduce actions consumption to be good citizens to fellow Googlers. If you have any questions, feel free to respond here or ping me on chat. Thank you!
2021-03-10 16:36:21 -05:00
Adin Scannell e74aa25e22 Fix Go branch building.
Files removed from the working tree were not being properly removed from
the branch, leading to symbol conflicts while building. This requires the
change to 'git add --all' in the tools/go_branch.sh script.

But why was this not caught by CI? The "git clean -f" command by default
only cleans files in the current working directory. In order to clean the
whole tree recursively, we need to specify a pathspec, which is ".".

In addition to these fixes, re-add the "go tests" command to help prevent
this from happening again, since merges on the Go branch will happen in
GitHub actions for simplicity. The Go test is retained in BuildKite.

PiperOrigin-RevId: 351503804
2021-01-12 20:33:28 -08:00
Adin Scannell a20da70829 Fix Go branch for arm64.
This requires several changes:
* Templates must preserve relevant tags.
* Pagetables templates are split into two targets, each preserving tags.
* The binary VDSO is similarly split into two targets, with some juggling.
* The top level tools/go_branch.sh now does a crossbuild of ARM64 as well,
  and checks and merges the results of the two branches together.

Fixes #5178

PiperOrigin-RevId: 351304330
2021-01-11 22:33:36 -08:00
Adin Scannell 2a5d3c248f Add YAML validation for configuration files.
For validation, the "on" key in existing YAML files is changed to a literal
string. In the YAML spec, on is a keyword which encodes a boolean value, so
without relying on a specific implementation the YAML files are technically
not encoding an object that complies with the specification.

PiperOrigin-RevId: 350172147
2021-01-05 10:43:04 -08:00
Tamir Duberstein 3ff7324dfa Avoid duplicate `run` key
This GitHub action has been failing since 4e963c9.

PiperOrigin-RevId: 349327675
2020-12-28 13:57:54 -08:00
Adin Scannell 4e963c99ce Cleanup GitHub actions workflows.
Also, drop the pull_request template, since this has not proved to be
helpful, and just results in a commit message the includes the list.

PiperOrigin-RevId: 347636507
2020-12-15 10:05:47 -08:00
Andrei Vagin bd3252d5cf github: Don't build the Go branch for feature branches
We can't actually push the Go branch on pushes to feature branches.

Signed-off-by: Andrei Vagin <avagin@google.com>
2020-09-09 14:56:59 -07:00
Andrei Vagin 27897621da github: run actions for feature branches
Signed-off-by: Andrei Vagin <avagin@google.com>
2020-09-09 10:56:11 -07:00
Fabricio Voznika 25babd6351 Run bazel build before deleting cached gopath files
bazel creates sysmlink to the cache on the first invokation.
On a new clone, there are no symlink, thus `rm -rf bazel-bin/gopath`
has no effect. Call `bazel build something` first, then delete
cached gopath.

PiperOrigin-RevId: 327536044
2020-08-19 17:05:45 -07:00
Adin Scannell 10f6c41bbd Include shim binaries in the Go branch.
PiperOrigin-RevId: 324615016
2020-08-03 09:09:51 -07:00
Adin Scannell a7d9aa6d5b Use proper set-output syntax.
PiperOrigin-RevId: 324302828
2020-07-31 16:08:29 -07:00
Adin Scannell cb1a3ba63a Fix merge flow for Go branch.
PiperOrigin-RevId: 324024075
2020-07-30 10:05:48 -07:00
Adin Scannell a05ea20ef1 Don't attempt to use the secret if it does not exist.
Fixes #3326

PiperOrigin-RevId: 323589669
2020-07-28 09:40:44 -07:00
Adin Scannell 0bc022b7f3 Fix push for Go branch.
PiperOrigin-RevId: 313419745
2020-05-27 10:49:04 -07:00
Adin Scannell 8437ef752d Normalize permissions in the go branch.
Fixes #2722
2020-05-20 22:57:52 -07:00
Adin Scannell cbfb55869e Implement Go branch updater with GitHub actions.
PiperOrigin-RevId: 312155686
2020-05-18 14:36:16 -07:00