Skip to content

Commit

Permalink
Merge pull request #17394 from spowelljr/speedUpFunctionalBuilds
Browse files Browse the repository at this point in the history
CI: GitHub Actions only build required test binaries
  • Loading branch information
medyagh authored Oct 13, 2023
2 parents 6e24cdb + 6d65e9c commit fdc9137
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 21 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ permissions:
contents: read

jobs:
# Runs before all other jobs
# builds the minikube binaries
build_minikube:
# Runs before before the functional tests
# builds the binaries required for testing
build_minikube_test_binaries:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand All @@ -33,8 +33,7 @@ jobs:
run: go mod download
- name: Build Binaries
run: |
make cross
make e2e-cross
make e2e-linux-amd64 e2e-darwin-amd64
cp -r test/integration/testdata ./out
whoami
echo github ref $GITHUB_REF
Expand All @@ -48,6 +47,20 @@ jobs:
with:
name: minikube_binaries
path: out
build_minikube:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: ${{env.GO_VERSION}}
cache-dependency-path: ./go.sum
- name: Download Dependencies
run: go mod download
- name: Build Binaries
run: |
make cross
make e2e-cross
lint:
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -91,7 +104,7 @@ jobs:
functional_docker_ubuntu:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_ubuntu"
Expand Down Expand Up @@ -189,7 +202,7 @@ jobs:
functional_docker_containerd_ubuntu:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_containerd_ubuntu"
Expand Down Expand Up @@ -288,7 +301,7 @@ jobs:
functional_podman_ubuntu:
permissions:
contents: none
needs: [ build_minikube ]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: functional_podman_ubuntu
Expand Down Expand Up @@ -390,7 +403,7 @@ jobs:
functional_virtualbox_macos:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_virtualbox_macos"
Expand Down Expand Up @@ -487,7 +500,7 @@ jobs:
functional_baremetal_ubuntu20_04:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_baremetal_ubuntu20_04"
Expand Down
35 changes: 24 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ permissions:
contents: read

jobs:
# Runs before all other jobs
# builds the minikube binaries
build_minikube:
# Runs before before the functional tests
# builds the binaries required for testing
build_minikube_test_binaries:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand All @@ -31,8 +31,7 @@ jobs:
run: go mod download
- name: Build Binaries
run: |
make cross
make e2e-cross
make e2e-linux-amd64 e2e-darwin-amd64
cp -r test/integration/testdata ./out
whoami
echo github ref $GITHUB_REF
Expand All @@ -46,6 +45,20 @@ jobs:
with:
name: minikube_binaries
path: out
build_minikube:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: ${{env.GO_VERSION}}
cache-dependency-path: ./go.sum
- name: Download Dependencies
run: go mod download
- name: Build Binaries
run: |
make cross
make e2e-cross
lint:
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -89,7 +102,7 @@ jobs:
functional_docker_ubuntu:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_ubuntu"
Expand Down Expand Up @@ -188,7 +201,7 @@ jobs:
functional_docker_containerd_ubuntu:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_containerd_ubuntu"
Expand Down Expand Up @@ -288,7 +301,7 @@ jobs:
functional_docker_rootless_containerd_ubuntu:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_rootless_containerd_ubuntu"
Expand Down Expand Up @@ -405,7 +418,7 @@ jobs:
functional_podman_ubuntu:
permissions:
contents: none
needs: [ build_minikube ]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: functional_podman_ubuntu
Expand Down Expand Up @@ -508,7 +521,7 @@ jobs:
functional_virtualbox_macos:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_virtualbox_macos"
Expand Down Expand Up @@ -606,7 +619,7 @@ jobs:
functional_baremetal_ubuntu20_04:
permissions:
contents: none
needs: [build_minikube]
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_baremetal_ubuntu20_04"
Expand Down

0 comments on commit fdc9137

Please sign in to comment.