Skip to content

Commit

Permalink
Let CI use parallel builds
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wieczorek <[email protected]>
  • Loading branch information
twz123 committed Oct 31, 2023
1 parent c16e041 commit 8f8cfde
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autopilot-branch-to-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Build Tool
run: |
cd hack/tool
make
make -j
- name: Save Build Tool Image
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-airgap-image-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:
run: |
mkdir -p "embedded-bins/staging/$TARGET_OS/bin"
make --touch airgap-images.txt
make "airgap-image-bundle-$TARGET_OS-$TARGET_ARCH.tar"
make -j "airgap-image-bundle-$TARGET_OS-$TARGET_ARCH.tar"
4 changes: 2 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Generate docs
env:
GH_TOKEN: ${{ github.token }}
run: make -C docs docs
run: make -j -C docs docs

- name: Upload site/
uses: actions/upload-artifact@v3
Expand All @@ -55,4 +55,4 @@ jobs:
uses: actions/checkout@v3

- name: Build docs dev container
run: make -C docs .docker-image.serve-dev.stamp
run: make -j -C docs .docker-image.serve-dev.stamp
6 changes: 3 additions & 3 deletions .github/workflows/build-k0s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ jobs:
- name: "Build :: k0s"
run: |
make bindata
make -j bindata
make --touch codegen
make build
make -j build
- name: "Upload :: k0s"
uses: actions/upload-artifact@v3
Expand All @@ -82,7 +82,7 @@ jobs:
- name: "Build :: Airgap image list"
if: inputs.target-os != 'windows'
run: make airgap-images.txt && cat airgap-images.txt
run: make -j airgap-images.txt && cat airgap-images.txt

- name: "Upload :: Airgap image list"
if: inputs.target-os != 'windows'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Build k0s Binary
id: k0s_build
run: |
make build
make -j build
KUBERNETES_VERSION="$(./vars.sh kubernetes_version)"
echo KUBERNETES_VERSION="$KUBERNETES_VERSION" >> $GITHUB_OUTPUT
working-directory: ./
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
./k0sctl kubeconfig > $KUBECONFIG
- name: Run Sonobuoy
run: make check-network
run: make -j check-network
working-directory: ./inttest

- name: Terraform Destroy
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Generate SBOM
run: |
make bindata
make -j bindata
mkdir -p sbom && chmod 777 sbom
make sbom/spdx.json
Expand Down Expand Up @@ -140,12 +140,12 @@ jobs:
env:
EMBEDDED_BINS_BUILDMODE: none
run: |
make bindata
make -j bindata
make --touch codegen
make check-unit
make -j check-unit
- name: Validate OCI images manifests
run: make check-image-validity
run: make -j check-image-validity

unittests-k0s-windows-amd64:
name: "Unit tests :: windows-amd64"
Expand Down Expand Up @@ -195,9 +195,9 @@ jobs:
GO_ENV: ''
run: |
make --touch .k0sbuild.docker-image.k0s go.sum
make bindata
make -j bindata
make --touch codegen
make check-unit
make -j check-unit
smoketests:
strategy:
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
echo Airgap image bundle file missing!
exit 1
}
make -C inttest ${{ matrix.smoke-suite }}
make -j -C inttest ${{ matrix.smoke-suite }}
- name: Collect k0s logs and support bundle
if: failure()
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
- name: Run inttest
run: |
make -C inttest check-ap-ha3x3 K0S_UPDATE_FROM_BIN="../k0s-$K0S_VERSION"
make -j -C inttest check-ap-ha3x3 K0S_UPDATE_FROM_BIN="../k0s-$K0S_VERSION"
- name: Collect k0s logs and support bundle
if: failure()
Expand Down Expand Up @@ -390,9 +390,9 @@ jobs:
- name: Build
run: |
make bindata
make -j bindata
make --touch codegen
make build
make -j build
- name: Upload compiled executable
uses: actions/upload-artifact@v3
Expand All @@ -401,16 +401,16 @@ jobs:
path: k0s

- name: Unit tests
run: make check-unit
run: make -j check-unit

- name: k0s sysinfo
run: ./k0s sysinfo

- name: Run smoketest
run: make check-basic
run: make -j check-basic

- name: Create airgap image list
run: make airgap-images.txt
run: make -j airgap-images.txt

- name: Cache airgap image bundle
id: cache-airgap-image-bundle
Expand All @@ -423,12 +423,12 @@ jobs:
- name: Create airgap image bundle if not cached
if: steps.cache-airgap-image-bundle.outputs.cache-hit != 'true'
run: make airgap-image-bundle-linux-${{ matrix.arch }}.tar
run: make -j airgap-image-bundle-linux-${{ matrix.arch }}.tar

- name: Run airgap test
run: |
make --touch airgap-image-bundle-linux-${{ matrix.arch }}.tar
make check-airgap
make -j check-airgap
- name: Collect k0s logs and support bundle
if: failure()
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ jobs:
~/.cache/golangci-lint
- name: Check go.mod/go.sum to be consistent
run: make --always-make go.sum && git diff --exit-code
run: make -j --always-make go.sum && git diff --exit-code

- name: Check generated code to be consistent
run: make codegen EMBEDDED_BINS_BUILDMODE=none && git diff --exit-code
run: make -j codegen EMBEDDED_BINS_BUILDMODE=none && git diff --exit-code

- name: Run linter
env:
EMBEDDED_BINS_BUILDMODE: none
GOLANGCI_LINT_FLAGS: --out-format=github-actions
run: |
make lint
make -j lint
validate-os-tests:
name: Validate OS tests
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ostests-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
env:
E2E_CONCURRENCY_LEVEL: ${{ inputs.e2e-concurrency-level }}
run: |
make bin/sonobuoy
make -j bin/sonobuoy
bin/sonobuoy run -p e2e --wait=120 \
--kubernetes-version=v"$KUBERNETES_VERSION" \
--plugin-env=e2e.E2E_PARALLEL=true \
Expand All @@ -165,7 +165,7 @@ jobs:
if: steps.e2e-run-parallel.conclusion != 'skipped'
working-directory: inttest
run: |
sonobuoyTarGz="$(make --silent get-conformance-results)"
sonobuoyTarGz="$(make -j --silent get-conformance-results)"
mv -- "$sonobuoyTarGz" sonobuoy-e2e-parallel.tar.gz
- name: "e2e tests :: Clear parallel run"
Expand All @@ -180,7 +180,7 @@ jobs:
working-directory: inttest
timeout-minutes: 180 # three hours
run: |
make bin/sonobuoy
make -j bin/sonobuoy
bin/sonobuoy run -p e2e --wait=120 \
--kubernetes-version=v"$KUBERNETES_VERSION" \
--plugin-env=e2e.E2E_FOCUS="$E2E_FOCUS" \
Expand All @@ -190,7 +190,7 @@ jobs:
id: e2e-retrieve-serial
working-directory: inttest
run: |
sonobuoyTarGz="$(make --silent get-conformance-results)"
sonobuoyTarGz="$(make -j --silent get-conformance-results)"
mv -- "$sonobuoyTarGz" sonobuoy-e2e-serial.tar.gz
- name: "Terraform :: Destroy"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Generate docs
env:
GH_TOKEN: ${{ github.token }}
run: make -C docs docs clean-k0s
run: make -j -C docs docs clean-k0s

- name: git config
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Generate docs
env:
GH_TOKEN: ${{ github.token }}
run: make -C docs docs clean-k0s
run: make -j -C docs docs clean-k0s

- name: git config
run: |
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: .github/workflows/prepare-build-env.sh

- name: Build
run: make EMBEDDED_BINS_BUILDMODE=docker
run: make -j EMBEDDED_BINS_BUILDMODE=docker
env:
VERSION: ${{ needs.release.outputs.tag_name }}

Expand All @@ -73,10 +73,10 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Run basic smoke test
run: make check-basic
run: make -j check-basic

- name: Create airgap image bundle
run: make airgap-image-bundle-linux-amd64.tar
run: make -j airgap-image-bundle-linux-amd64.tar

- name: Collect smoke test logs
if: failure()
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
uses: actions/checkout@v3

- name: Build
run: make EMBEDDED_BINS_BUILDMODE=docker k0s.exe
run: make -j EMBEDDED_BINS_BUILDMODE=docker k0s.exe
env:
VERSION: ${{ needs.release.outputs.tag_name }}

Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
working-directory: ./

- name: Build
run: make EMBEDDED_BINS_BUILDMODE=docker
run: make -j EMBEDDED_BINS_BUILDMODE=docker
env:
VERSION: ${{ needs.release.outputs.tag_name }}

Expand All @@ -262,10 +262,10 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Run basic smoke test
run: make check-basic
run: make -j check-basic

- name: Create airgap image bundle
run: make airgap-image-bundle-linux-arm64.tar
run: make -j airgap-image-bundle-linux-arm64.tar

- name: Collect smoke test logs
if: failure()
Expand Down Expand Up @@ -342,7 +342,7 @@ jobs:
working-directory: ./

- name: Build
run: make EMBEDDED_BINS_BUILDMODE=docker
run: make -j EMBEDDED_BINS_BUILDMODE=docker
env:
VERSION: ${{ needs.release.outputs.tag_name }}

Expand Down Expand Up @@ -379,10 +379,10 @@ jobs:
echo ::endgroup::
- name: Run basic smoke test
run: make check-basic
run: make -j check-basic

- name: Create airgap image bundle
run: make airgap-image-bundle-linux-arm.tar
run: make -j airgap-image-bundle-linux-arm.tar

- name: Collect smoke test logs
if: failure()
Expand Down Expand Up @@ -628,12 +628,12 @@ jobs:
./k0sctl kubeconfig > $KUBECONFIG
- name: Run Full Conformance Check
run: make check-conformance
run: make -j check-conformance
working-directory: ./inttest

- name: Retrieve Sonobuoy Results
run: |
make get-conformance-results
make -j get-conformance-results
working-directory: ./inttest

- name: Upload conformance test result to Release Assets
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sbom-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
run: |
make bindata
make -j bindata
mkdir -p sbom && chmod 777 sbom
echo $COSIGN_KEY | base64 -d > cosign.key
make sign-sbom
Expand Down
3 changes: 3 additions & 0 deletions vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -eu

# Don't deal with recursive make stuff here!
unset -v MAKEFLAGS MAKELEVEL

from=
var=

Expand Down

0 comments on commit 8f8cfde

Please sign in to comment.