This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
feat: build operator image with chainguard #611
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: Pull request | |
on: | |
- pull_request | |
jobs: | |
tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Go vet | |
run: | | |
make vet | |
- name: Unit tests | |
run: | | |
make test | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get short commit hash | |
run: echo "SHORT_SHA=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Build | |
run: | | |
make build VERSION=dev-${{ env.SHORT_SHA }} | |
# - name: Docker Image | |
# uses: docker/build-push-action@v6 | |
# with: | |
# push: true | |
# tags: | | |
# ttl.sh/embedded-cluster-operator-image:dev-${{ env.SHORT_SHA }} | |
- name: Prepare image build | |
run: | | |
export VERSION=$(git describe --tags --dirty) | |
make melange-template | |
make apko-template | |
cp bin/manager manager | |
- name: Build melange package | |
uses: ./.github/actions/build-custom-melange-package | |
with: | |
component: embedded-cluster-operator | |
config: deploy/melange.yaml | |
archs: amd64 | |
- name: Build apko image | |
uses: ./.github/actions/build-custom-image-with-apko | |
with: | |
component: embedded-cluster-operator | |
config: deploy/apko.yaml | |
archs: amd64 | |
check-crds: | |
name: Check CRDs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Make Manifests | |
run: make manifests | |
- name: Check CRDs | |
run: | | |
git diff --exit-code --name-only | |
if [ $? -eq 0 ]; then | |
echo "CRDs are up to date" | |
else | |
echo "CRDs are out of date" | |
exit 1 | |
fi |