Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are environment variables case-insensitive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you save a var, it's automatically capitalised. Retrieval is case-insensitive.


#### 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
Expand Down
2 changes: 1 addition & 1 deletion templates/.github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though https://github.com/orgs/community/discussions/44322 hasn't been picked up by anyone from GitHub yet, I think we should proceed with this solution. It introduces a way for experimentation with self-hosted runners. In this context, it could be viewed as an upside that it wouldn't extend to external contributors' PRs yet

@galargh Can you clarify what happens when run from a fork? It would claim that it's a requirement that PRs authored by outside contributors (i.e. on their forks) work, otherwise we won't be able to accept any community contributions.

Sure! PRs from forks do not have access to vars yet, so, even if the custom runner variable is set, they'll be using a fallback to format('"{0}-latest"', matrix.os) (the default hosted runners).

name: ${{ matrix.os }} (go ${{ matrix.go }})
steps:
- uses: actions/checkout@v3
Expand Down