Optimizations for main build workflow #4857
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
gomod: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- run: make go-mod-tidy | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- run: make go-mod-tidy | |
- run: make golint | |
test: | |
runs-on: ubuntu-20.04 | |
needs: lint | |
strategy: | |
fail-fast: false | |
matrix: | |
testSuite: [test, integration-test, helm-test] | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- uses: helm/[email protected] | |
- run: | | |
make install-csi-hostpath-driver | |
make install-minio | |
if: matrix.testSuite == 'integration-test' || matrix.testSuite == 'helm-test' | |
- run: make go-mod-tidy | |
# A test (CRDSuite) that runs as part of `make test` requies atleast one CRD to | |
# be present on the cluster. That's why we are only installing csi-hostpath-driver | |
# before running `make test`, to create some CRDs on the cluster. | |
- run: | | |
make install-csi-hostpath-driver | |
make install-minio | |
if: matrix.testSuite == 'test' | |
- run: make ${{ matrix.testSuite }} | |
build: | |
runs-on: ubuntu-20.04 | |
needs: [lint] | |
strategy: | |
matrix: | |
bin: [controller, kanctl, kando] | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- run: make go-mod-tidy | |
- run: make build BIN=${{ matrix.bin }} GOBORING=true | |
docs: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- run: make go-mod-tidy | |
- run: make docs | |
release: | |
runs-on: ubuntu-20.04 | |
needs: [test, build] | |
if: github.ref_name == 'master' || startsWith(github.ref, 'refs/tags') | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- run: make go-mod-tidy | |
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- run: sudo rm -rf /usr/share/dotnet | |
- run: sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- run: make release-snapshot | |
- run: ./build/push_images.sh |