Skip to content

Commit 6981eba

Browse files
author
Paulo Gomes
committed
build: split GitHub workflows
By splitting workflows we can get the overall time for all the checks to be decreased. Signed-off-by: Paulo Gomes <[email protected]>
1 parent 3cbb9ca commit 6981eba

File tree

3 files changed

+111
-41
lines changed

3 files changed

+111
-41
lines changed

.github/workflows/e2e.yaml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,11 @@ jobs:
2727
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
2828
restore-keys: |
2929
${{ runner.os }}-go-
30-
- name: Verify
31-
run: make verify
3230
- name: Enable integration tests
3331
# Only run integration tests for main branch
3432
if: github.ref == 'refs/heads/main'
3533
run: |
3634
echo 'GO_TAGS=integration' >> $GITHUB_ENV
37-
- name: Run tests
38-
env:
39-
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
40-
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
41-
run: make test
4235
- name: Setup Kubernetes
4336
uses: engineerd/[email protected]
4437
with:
@@ -69,19 +62,6 @@ jobs:
6962
if: github.ref == 'refs/heads/main'
7063
run: |
7164
echo 'GO_TAGS=integration' >> $GITHUB_ENV
72-
- name: Run tests
73-
env:
74-
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
75-
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
76-
77-
# Temporarily disabling -race for arm64 as our GitHub action
78-
# runners don't seem to like it. The race detection was tested
79-
# on both Apple M1 and Linux arm64 with successful results.
80-
#
81-
# We should reenable go test -race for arm64 runners once the
82-
# current issue is resolved.
83-
GO_TEST_ARGS: ''
84-
run: make test
8565
- name: Prepare
8666
id: prep
8767
run: |
@@ -103,24 +83,3 @@ jobs:
10383
run: |
10484
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
10585
rm /tmp/${{ steps.prep.outputs.CLUSTER }}
106-
107-
# Runs 'make test' on macos-10.15 to assure development environment for
108-
# contributors using MacOS.
109-
darwin-amd64:
110-
runs-on: macos-10.15
111-
steps:
112-
- name: Checkout
113-
uses: actions/checkout@v3
114-
- name: Setup Go
115-
uses: actions/setup-go@v3
116-
with:
117-
go-version: 1.17.x
118-
- name: Restore Go cache
119-
uses: actions/cache@v3
120-
with:
121-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
122-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
123-
restore-keys: |
124-
${{ runner.os }}-go-
125-
- name: Run tests
126-
run: make test

.github/workflows/tests.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read # for actions/checkout to fetch code
11+
12+
jobs:
13+
14+
test-linux-amd64:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Setup Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: 1.17.x
23+
- name: Restore Go cache
24+
uses: actions/cache@v3
25+
with:
26+
path: /home/runner/work/_temp/_github_home/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
- name: Run tests
31+
env:
32+
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
33+
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
34+
run: make test
35+
36+
test-linux-arm64:
37+
# Hosted on Equinix
38+
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
39+
runs-on: [self-hosted, Linux, ARM64, equinix]
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v3
43+
- name: Setup Go
44+
uses: actions/setup-go@v3
45+
with:
46+
go-version: 1.17.x
47+
- name: Run tests
48+
env:
49+
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
50+
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
51+
52+
# Temporarily disabling -race for arm64 as our GitHub action
53+
# runners don't seem to like it. The race detection was tested
54+
# on both Apple M1 and Linux arm64 with successful results.
55+
#
56+
# We should reenable go test -race for arm64 runners once the
57+
# current issue is resolved.
58+
GO_TEST_ARGS: ''
59+
run: make test
60+
61+
# Runs 'make test' on macos-10.15 to assure development environment for
62+
# contributors using MacOS.
63+
darwin-amd64:
64+
runs-on: macos-10.15
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v3
68+
- name: Setup Go
69+
uses: actions/setup-go@v3
70+
with:
71+
go-version: 1.17.x
72+
- name: Restore Go cache
73+
uses: actions/cache@v3
74+
with:
75+
path: /home/runner/work/_temp/_github_home/go/pkg/mod
76+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
77+
restore-keys: |
78+
${{ runner.os }}-go-
79+
- name: Run tests
80+
run: make test

.github/workflows/verify.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: verify
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read # for actions/checkout to fetch code
11+
12+
jobs:
13+
14+
verify-linux-amd64:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Setup Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: 1.17.x
23+
- name: Restore Go cache
24+
uses: actions/cache@v3
25+
with:
26+
path: /home/runner/work/_temp/_github_home/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
- name: Verify
31+
run: make verify

0 commit comments

Comments
 (0)