This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
feat: build operator image with chainguard #632
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: | |
get-tag: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.tag.outputs.tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get tag | |
id: tag | |
run: echo "tag=$(git rev-parse --short=7 HEAD)" >> "$GITHUB_OUTPUT" | |
test: | |
runs-on: ubuntu-latest | |
needs: [get-tag] | |
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: | |
runs-on: ubuntu-latest | |
needs: [get-tag] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Build | |
run: | | |
export VERSION=${{needs.get-tag.outputs.tag}} | |
make build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: manager | |
path: ./bin/manager | |
package-operator: | |
runs-on: ubuntu-latest | |
needs: [get-tag] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build melange package | |
run: | | |
export VERSION=${{needs.get-tag.outputs.tag}} | |
make melange | |
- name: Build apko image | |
run: | | |
export VERSION=${{needs.get-tag.outputs.tag}} | |
export IMAGE=ttl.sh/embedded-cluster-operator-image:dev-${VERSION} | |
make apko-build | |
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 |