Skip to content

Commit

Permalink
feat: ci: control the use of self-hosted runners with CUSTOM_RUNNERS_…
Browse files Browse the repository at this point in the history
…ENABLED configuration variable
  • Loading branch information
galargh committed Jun 21, 2024
1 parent 286fada commit adf5f3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
submodules: 'recursive'
- id: test
env:
custom-runners-enabled: ${{ vars.CUSTOM_RUNNERS_ENABLED || 'false' }}
# Unit test groups other than unit-rest
utests: |
[
Expand Down Expand Up @@ -157,7 +158,9 @@ jobs:
groups="$(jq -n --argjson i "$itests" --argjson u "$utests" --argjson r "$rest" --argjson o "$otests" '$i + $u + [$r] + $o')"
# Apply custom runner labels to the groups
groups="$(jq -n --argjson g "$groups" --argjson r "$runners" '$g | map(. + {"runner": (.name as $n | $r | .[$n]) })')"
if [[ "$custom-runners-enabled" == "true" ]]; then
groups="$(jq -n --argjson g "$groups" --argjson r "$runners" '$g | map(. + {"runner": (.name as $n | $r | .[$n]) })')"
fi
# Apply the needs_yugabytedb flag to the groups
groups="$(jq -n --argjson g "$groups" --argjson y "$yugabytedb" '$g | map(. + {"needs_yugabytedb": ([.name] | inside($y)) })')"
Expand Down Expand Up @@ -235,7 +238,7 @@ jobs:
test:
needs: [discover, cache]
name: Test (${{ matrix.name }})
runs-on: ${{ github.repository == 'filecoin-project/lotus' && matrix.runner || 'ubuntu-latest' }}
runs-on: ${{ matrix.runner || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit adf5f3d

Please sign in to comment.