Skip to content

Commit e8788c5

Browse files
ci: test on different architectures
1 parent 723a397 commit e8788c5

File tree

2 files changed

+109
-88
lines changed

2 files changed

+109
-88
lines changed

.github/workflows/push.yaml

Lines changed: 7 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -15,94 +15,13 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
binaries:
19-
name: Build concierge
20-
runs-on: ubuntu-latest
21-
steps:
22-
- name: Check out the code
23-
uses: actions/checkout@v5
24-
with:
25-
fetch-depth: 0
26-
27-
- name: Setup Go
28-
uses: actions/setup-go@v6
29-
with:
30-
go-version-file: "go.mod"
31-
32-
- name: Run tests
33-
run: |
34-
go test -v -race ./...
35-
36-
- name: Setup goreleaser
37-
run: |
38-
sudo snap install --classic goreleaser
39-
40-
- name: Build concierge
41-
id: build
42-
run: |
43-
goreleaser build --clean --snapshot --single-target --output .
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
47-
- name: Upload binary artifact
48-
uses: actions/upload-artifact@v4
49-
with:
50-
name: binary
51-
path: ./concierge
52-
53-
define-matrix:
54-
name: Define spread matrix
55-
runs-on: ubuntu-24.04
56-
outputs:
57-
suites: ${{ steps.suites.outputs.suites }}
58-
steps:
59-
- name: Checkout
60-
uses: actions/checkout@v5
61-
62-
- name: Setup Go
63-
uses: actions/setup-go@v6
64-
65-
- name: Install
66-
run: |
67-
go install github.com/snapcore/spread/cmd/spread@latest
68-
69-
- name: Generate matrix list
70-
id: suites
71-
run: |
72-
list="$(spread -list github-ci | sed "s|github-ci:ubuntu-24.04:tests/||g" | jq -r -ncR '[inputs | select(length>0)]')"
73-
echo "suites=$list"
74-
echo "suites=$list" >> $GITHUB_OUTPUT
75-
76-
spread-test:
77-
name: Spread (${{ matrix.suite }})
78-
runs-on: ubuntu-24.04
79-
needs:
80-
- binaries
81-
- define-matrix
18+
tests:
8219
strategy:
8320
fail-fast: false
8421
matrix:
85-
suite: ${{ fromJSON(needs.define-matrix.outputs.suites) }}
86-
steps:
87-
- name: Checkout
88-
uses: actions/checkout@v5
89-
90-
- name: Download binary artifact
91-
uses: actions/download-artifact@v5
92-
with:
93-
name: binary
94-
95-
- name: Setup Go
96-
uses: actions/setup-go@v6
97-
with:
98-
go-version-file: "go.mod"
99-
100-
- name: Install
101-
run: |
102-
go install github.com/snapcore/spread/cmd/spread@latest
103-
104-
- name: Run integration tests
105-
run: |
106-
sudo apt-get remove -y docker-ce docker-ce-cli containerd.io
107-
sudo rm -rf /run/containerd
108-
spread -v "github-ci:ubuntu-24.04:tests/${{ matrix.suite }}"
22+
runner:
23+
- ubuntu-24.04
24+
- self-hosted-linux-ppc64el-noble-edge
25+
- self-hosted-linux-s390x-noble-edge
26+
uses: ./.github/workflows/tests.yaml
27+
runner: ${{ matrix.runner }}

.github/workflows/tests.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
binaries:
12+
name: Build concierge
13+
runs-on: ${{ inputs.runner }}
14+
steps:
15+
- name: Check out the code
16+
uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v6
22+
with:
23+
go-version-file: "go.mod"
24+
25+
- name: Run tests
26+
run: |
27+
go test -v -race ./...
28+
29+
- name: Setup goreleaser
30+
run: |
31+
sudo snap install --classic goreleaser
32+
33+
- name: Build concierge
34+
id: build
35+
run: |
36+
goreleaser build --clean --snapshot --single-target --output .
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Upload binary artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: binary-${{ inputs.runner }}
44+
path: ./concierge
45+
46+
define-matrix:
47+
name: Define spread matrix
48+
runs-on: ${{ inputs.runner }}
49+
outputs:
50+
suites: ${{ steps.suites.outputs.suites }}
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v5
54+
55+
- name: Setup Go
56+
uses: actions/setup-go@v6
57+
58+
- name: Install
59+
run: |
60+
go install github.com/snapcore/spread/cmd/spread@latest
61+
62+
- name: Generate matrix list
63+
id: suites
64+
run: |
65+
list="$(spread -list github-ci | sed "s|github-ci:ubuntu-24.04:tests/||g" | jq -r -ncR '[inputs | select(length>0)]')"
66+
echo "suites=$list"
67+
echo "suites=$list" >> $GITHUB_OUTPUT
68+
69+
spread-test:
70+
name: Spread (${{ matrix.suite }})
71+
runs-on: ${{ inputs.runner }}
72+
needs:
73+
- binaries
74+
- define-matrix
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
suite: ${{ fromJSON(needs.define-matrix.outputs.suites) }}
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v5
82+
83+
- name: Download binary artifact
84+
uses: actions/download-artifact@v5
85+
with:
86+
name: binary-${{ inputs.runner }}
87+
88+
- name: Setup Go
89+
uses: actions/setup-go@v6
90+
with:
91+
go-version-file: "go.mod"
92+
93+
- name: Install
94+
run: |
95+
go install github.com/snapcore/spread/cmd/spread@latest
96+
97+
- name: Run integration tests
98+
run: |
99+
sudo apt-get remove -y docker-ce docker-ce-cli containerd.io
100+
sudo rm -rf /run/containerd
101+
spread -v "github-ci:ubuntu-24.04:tests/${{ matrix.suite }}"
102+

0 commit comments

Comments
 (0)