pulumi/scripts
Abhinav Gupta 8f594326a2
ci: Don't run codegen tests for PRs
We currently run all codegen tests in pkg/codegen/$lang
for every PR.
These tests take quite a while to run and lock up many GitHub workers
for this entire duration.

This change attempts to address this issue
by running codegen tests only for those PRs
that touch the codegen directories.

The machinery to make this work is roughly as follows:

- In the on-pr workflow, when we're figuring out what we're doing,
  we check if we've changed codegen files.
  We use [paths-filter] to do this.
- We decide whether we want to run codegen tests based on those files,
  and pass that onto the test matrix generator.
- The test matrix generator filters out these packages
  and their subpackages from the list of tests under consideration.
- Everything else proceeds as normal.

[paths-filter]: https://github.com/dorny/paths-filter

Things to note:

- The test-codegen input defaults to true.
  All other invocations will run with codegen tests
  so these will continue to run on merge.
  Only PRs (from on-pr.yml) set it to false.
- Since the number of tests is remarkably smaller without these tests,
  we can significantly reduce the number of partitions we use
  for pkg/ unit tests.
  This should alleviate pressure on GitHub workers further.

This is a pretty blunt approach to the problem.
If we wanted to be more targeted,
instead of filtering at the get-job-matrix.py level,
we could instead set an environment variable
and add t.Skips in {program,sdk,type}_driver
if that environment variable is set.
And we can still do that in the future
if we decide that maintaining this list is too much.

Resolves #12334
2023-03-13 11:18:38 -07:00
..
brew.sh ci: Enable goreleaser prep script to build for local os & arch 2022-09-16 09:50:10 -07:00
get-job-matrix.py ci: Don't run codegen tests for PRs 2023-03-13 11:18:38 -07:00
get-language-providers.sh Update pulumi-dotnet to v3.54.0 2023-02-14 10:57:46 +01:00
get-pulumi-watch.sh ci: Enable goreleaser prep script to build for local os & arch 2022-09-16 09:50:10 -07:00
get-version ci: ensure trunk is always green 2022-09-13 13:38:14 -07:00
git-linear-history-check.sh ci: block non-linear merges 2022-11-08 11:22:32 -08:00
go-test.py ci: Enable testing of language version sets 2022-09-21 09:48:38 -07:00
go-update.sh ci: Remove -compat=1.18 flags to validate that tests pass on current and minimum supported Go versions 2022-09-27 10:41:25 -07:00
go-wrapper.sh [ci] Use Linux runners to build binaries in tests, macOS runners in releases & prereleases (#10427) 2022-08-22 08:08:13 -07:00
integration_test_subsets.py Remove dotnet 2022-12-13 16:13:53 +00:00
normpath Toward replacing MSBuild with make+bash on Windows (#8617) 2022-01-07 22:27:14 -05:00
prep-for-goreleaser.sh ci: Enable goreleaser prep script to build for local os & arch 2022-09-16 09:50:10 -07:00
publish_npm.sh ci: ensure trunk is always green 2022-09-13 13:38:14 -07:00
pulumi-version.sh ci: ensure trunk is always green 2022-09-13 13:38:14 -07:00
release.sh Fix mislabeling in error message of release script (#10421) 2022-08-17 10:51:03 +01:00
retry scripts/retry: set-output is deprecated 2023-03-01 14:11:23 -08:00
reversion.js Substitute ${VERSION} on Windows builds too 2018-02-20 14:37:28 -08:00
tidy.sh chore: Update go modules via go mod tidy 2022-10-05 12:17:41 -04:00
versions.sh ci: ensure trunk is always green 2022-09-13 13:38:14 -07:00