Skip to content

Commit bffe181

Browse files
committed
Test flavors
1 parent 99fa845 commit bffe181

File tree

4 files changed

+76
-23
lines changed

4 files changed

+76
-23
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: build
22

33
on:
44
workflow_call:
5+
inputs:
6+
flavor:
7+
description: flavor of Dockerfile, e.g., actions-runner.ubuntu-22.04
8+
required: true
9+
type: string
510
outputs:
611
image-uri:
712
description: image URI
@@ -34,12 +39,13 @@ jobs:
3439
id: metadata
3540
with:
3641
images: ghcr.io/${{ github.repository }}/runner
42+
flavor: suffix=${{ inputs.flavor }}
3743
- uses: docker/setup-buildx-action@v2
3844
- uses: docker/build-push-action@v3
3945
id: build
4046
with:
4147
context: runner
42-
file: runner/actions-runner-dind.ubuntu-22.04.dockerfile
48+
file: runner/${{ inputs.flavor }}.dockerfile
4349
push: true
4450
tags: ${{ steps.metadata.outputs.tags }}
4551
labels: ${{ steps.metadata.outputs.labels }}

.github/workflows/run.yaml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
11
name: run
22

33
on:
4-
pull_request:
5-
paths:
6-
- .github/workflows/run.yaml
7-
- Makefile
8-
- aqua.yaml
9-
- helmfile.yaml
10-
push:
11-
branches:
12-
- main
13-
paths:
14-
- .github/workflows/run.yaml
15-
- Makefile
16-
- aqua.yaml
17-
- helmfile.yaml
18-
19-
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}
21-
cancel-in-progress: true
4+
workflow_call:
5+
inputs:
6+
flavor:
7+
description: flavor of Dockerfile, e.g., actions-runner.ubuntu-22.04
8+
required: true
9+
type: string
2210

2311
jobs:
2412
build:
2513
uses: ./.github/workflows/build.yaml
14+
with:
15+
flavor: ${{ inputs.flavor }}
2616
permissions:
2717
contents: read
2818
packages: write
2919

20+
params:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 10
23+
outputs:
24+
runner-set: ${{ steps.generate.outputs.runner-set }}
25+
steps:
26+
- uses: actions/github-script@v6
27+
id: generate
28+
env:
29+
flavor: ${{ inputs.flavor }}
30+
with:
31+
script: |
32+
core.setOutput('runner-set', process.env.flavor.replaceAll('.', '-'))
33+
3034
controller:
31-
needs: build
35+
needs:
36+
- build
37+
- params
3238
runs-on: ubuntu-latest
3339
timeout-minutes: 10
3440
steps:
@@ -39,6 +45,7 @@ jobs:
3945
- run: make cluster
4046
- run: make deploy
4147
env:
48+
RUNNER_SET: ${{ needs.params.outputs.runner-set }}
4249
RUNNER_IMAGE_URI: ${{ needs.build.outputs.image-uri }}
4350
APP_ID: ${{ secrets.APP_ID }}
4451
APP_INSTALLATION_ID: ${{ secrets.APP_INSTALLATION_ID }}
@@ -48,8 +55,10 @@ jobs:
4855
run: make logs
4956

5057
runner:
51-
needs: build
52-
runs-on: arc-runner-set
58+
needs:
59+
- build
60+
- params
61+
runs-on: ${{ needs.params.outputs.runner-set }}
5362
timeout-minutes: 10
5463
steps:
5564
- uses: actions/checkout@v3

.github/workflows/test.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/run.yaml
7+
- Makefile
8+
- aqua.yaml
9+
- helmfile.yaml
10+
push:
11+
branches:
12+
- main
13+
paths:
14+
- .github/workflows/run.yaml
15+
- Makefile
16+
- aqua.yaml
17+
- helmfile.yaml
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
flavor:
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
flavor:
29+
- actions-runner.ubuntu-22.04
30+
- actions-runner-dind.ubuntu-22.04
31+
- actions-runner-dind-rootless.ubuntu-22.04
32+
uses: ./.github/workflows/run.yaml
33+
with:
34+
flavor: ${{ matrix.flavor }}
35+
permissions:
36+
contents: read
37+
packages: write
38+
secrets: inherit

helmfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ releases:
1111
chart: actions-runner-controller-charts/gha-runner-scale-set-controller
1212
version: 0.4.0
1313

14-
- name: arc-runner-set
14+
- name: {{ requiredEnv "RUNNER_SET" | quote }}
1515
namespace: arc-runners
1616
chart: actions-runner-controller-charts/gha-runner-scale-set
1717
version: 0.4.0

0 commit comments

Comments
 (0)