From af437b99b2d428f1374520771a39c56e85ec37af Mon Sep 17 00:00:00 2001 From: galargh Date: Fri, 13 Jan 2023 09:38:50 +0100 Subject: [PATCH 1/2] feat: allow configuring custom go-test runners --- templates/.github/workflows/go-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/.github/workflows/go-test.yml b/templates/.github/workflows/go-test.yml index 07f9cf52..c229ce10 100644 --- a/templates/.github/workflows/go-test.yml +++ b/templates/.github/workflows/go-test.yml @@ -11,7 +11,7 @@ jobs: env: COVERAGES: "" SKIP32BIT: false - runs-on: ${{ format('{0}-latest', matrix.os) }} + runs-on: ${{ fromJSON(vars[format('UCI_GO_TEST_RUNNER_{0}', matrix.os)] || format('"{0}-latest"', matrix.os)) }} name: ${{ matrix.os }} (go ${{ matrix.go }}) steps: - uses: actions/checkout@v3 From 616fba188b35b4d2deb8d57d86c5e4c2fe76a597 Mon Sep 17 00:00:00 2001 From: galargh Date: Fri, 13 Jan 2023 09:49:12 +0100 Subject: [PATCH 2/2] docs: update readme to include info on configuration variables --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 022220dc..be5052bc 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,15 @@ By storing them in a central place (here), and distributing them in an automated ### Additional Setup Steps Most repositories won't need any customization, and the workflows defined here will just work fine. + +#### Configuration Variables + +Some aspects of Unified CI workflows are configurable through [configuration variables](https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository). + +You can customise the runner type for `go-test` through `UCI_GO_TEST_RUNNER_UBUNTU`, `UCI_GO_TEST_RUNNER_WINDOWS` and `UCI_GO_TEST_RUNNER_MACOS` configuration variables. This option will be useful for repositories wanting to use more powerful, [PL self-hosted GitHub Actions runners](https://github.com/pl-strflt/tf-aws-gh-runner). + +#### Setup Actions + Some repositories may require some pre-setup steps to be run before tests (or code checks) can be run. Setup steps for `go-test` are defined in `.github/actions/go-test-setup/action.yml`, and setup steps for `go-check` are defined in `.github/actions/go-check-setup/action.yml`, in the following format: ```yml