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 <paulo.gomes@weave.works>
This commit is contained in:
parent
3cbb9ca5f4
commit
6981eba031
|
@ -27,18 +27,11 @@ jobs:
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-
|
${{ runner.os }}-go-
|
||||||
- name: Verify
|
|
||||||
run: make verify
|
|
||||||
- name: Enable integration tests
|
- name: Enable integration tests
|
||||||
# Only run integration tests for main branch
|
# Only run integration tests for main branch
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
echo 'GO_TAGS=integration' >> $GITHUB_ENV
|
echo 'GO_TAGS=integration' >> $GITHUB_ENV
|
||||||
- name: Run tests
|
|
||||||
env:
|
|
||||||
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
|
|
||||||
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
|
|
||||||
run: make test
|
|
||||||
- name: Setup Kubernetes
|
- name: Setup Kubernetes
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
uses: engineerd/setup-kind@v0.5.0
|
||||||
with:
|
with:
|
||||||
|
@ -69,19 +62,6 @@ jobs:
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
echo 'GO_TAGS=integration' >> $GITHUB_ENV
|
echo 'GO_TAGS=integration' >> $GITHUB_ENV
|
||||||
- name: Run tests
|
|
||||||
env:
|
|
||||||
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
|
|
||||||
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
|
|
||||||
|
|
||||||
# Temporarily disabling -race for arm64 as our GitHub action
|
|
||||||
# runners don't seem to like it. The race detection was tested
|
|
||||||
# on both Apple M1 and Linux arm64 with successful results.
|
|
||||||
#
|
|
||||||
# We should reenable go test -race for arm64 runners once the
|
|
||||||
# current issue is resolved.
|
|
||||||
GO_TEST_ARGS: ''
|
|
||||||
run: make test
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prep
|
id: prep
|
||||||
run: |
|
run: |
|
||||||
|
@ -103,24 +83,3 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
|
kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
|
||||||
rm /tmp/${{ steps.prep.outputs.CLUSTER }}
|
rm /tmp/${{ steps.prep.outputs.CLUSTER }}
|
||||||
|
|
||||||
# Runs 'make test' on macos-10.15 to assure development environment for
|
|
||||||
# contributors using MacOS.
|
|
||||||
darwin-amd64:
|
|
||||||
runs-on: macos-10.15
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v3
|
|
||||||
with:
|
|
||||||
go-version: 1.17.x
|
|
||||||
- name: Restore Go cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: /home/runner/work/_temp/_github_home/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- name: Run tests
|
|
||||||
run: make test
|
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
name: tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
test-linux-amd64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: 1.17.x
|
||||||
|
- name: Restore Go cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /home/runner/work/_temp/_github_home/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
|
||||||
|
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
|
||||||
|
run: make test
|
||||||
|
|
||||||
|
test-linux-arm64:
|
||||||
|
# Hosted on Equinix
|
||||||
|
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
|
||||||
|
runs-on: [self-hosted, Linux, ARM64, equinix]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: 1.17.x
|
||||||
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
|
||||||
|
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
|
||||||
|
|
||||||
|
# Temporarily disabling -race for arm64 as our GitHub action
|
||||||
|
# runners don't seem to like it. The race detection was tested
|
||||||
|
# on both Apple M1 and Linux arm64 with successful results.
|
||||||
|
#
|
||||||
|
# We should reenable go test -race for arm64 runners once the
|
||||||
|
# current issue is resolved.
|
||||||
|
GO_TEST_ARGS: ''
|
||||||
|
run: make test
|
||||||
|
|
||||||
|
# Runs 'make test' on macos-10.15 to assure development environment for
|
||||||
|
# contributors using MacOS.
|
||||||
|
darwin-amd64:
|
||||||
|
runs-on: macos-10.15
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: 1.17.x
|
||||||
|
- name: Restore Go cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /home/runner/work/_temp/_github_home/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
- name: Run tests
|
||||||
|
run: make test
|
|
@ -0,0 +1,31 @@
|
||||||
|
name: verify
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
verify-linux-amd64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: 1.17.x
|
||||||
|
- name: Restore Go cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: /home/runner/work/_temp/_github_home/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
- name: Verify
|
||||||
|
run: make verify
|
Loading…
Reference in New Issue