Skip to content

chore(actions): update actions/configure-pages action to v5 #766

chore(actions): update actions/configure-pages action to v5

chore(actions): update actions/configure-pages action to v5 #766

Workflow file for this run

name: Run Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
check-generate:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Check that generated artifacts are up-to-date
run: |
make generate
echo "Running 'git status' ..."
git status --porcelain | tee status.out
if [[ -s status.out ]]; then
echo "Generated artifacts are not up-to-date; probably 'make generate' was not run before committing"
exit 1
else
echo "Generated artifacts are up-to-date"
fi
unit-and-integration-tests:
runs-on: ubuntu-22.04
needs: check-generate
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run tests
run: |
make test
test-scaffold:
runs-on: ubuntu-22.04
needs:
- check-generate
- unit-and-integration-tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build scaffold
run: |
go build -o bin/scaffold -ldflags "-X \"main.version=$(pwd)\"" ./scaffold
echo "Running 'scaffold --version' ..."
bin/scaffold --version
- name: Run scaffold (without admission webhooks)
run: |
rm -rf $RUNNER_TEMP/src
mkdir $RUNNER_TEMP/src
./bin/scaffold \
--group-name example.io \
--group-version v1alpha1 \
--kind MyComponent \
--operator-name mycomponent-operator.example.io \
--go-module example.io/mycomponent-operator \
--image mycomponent-operator:latest \
$RUNNER_TEMP/src
- name: Build generated operator (without admission webhooks)
run: |
cd $RUNNER_TEMP/src
make build
- name: Test generated operator (without admission webhooks)
run: |
cd $RUNNER_TEMP/src
make test
- name: Validate generation of typed client (without admission webhooks)
run: |
cd $RUNNER_TEMP/src
make generate-client
- name: Run scaffold (with admission webhooks)
run: |
rm -rf $RUNNER_TEMP/src
mkdir $RUNNER_TEMP/src
./bin/scaffold \
--group-name example.io \
--group-version v1alpha1 \
--kind MyComponent \
--with-validating-webhook \
--with-mutating-webhook \
--operator-name mycomponent-operator.example.io \
--go-module example.io/mycomponent-operator \
--image mycomponent-operator:latest \
$RUNNER_TEMP/src
- name: Build generated operator (with admission webhooks)
run: |
cd $RUNNER_TEMP/src
make build
- name: Test generated operator (with admission webhooks)
run: |
cd $RUNNER_TEMP/src
make test
- name: Validate generation of typed client (with admission webhooks)
run: |
cd $RUNNER_TEMP/src
make generate-client
# commented out until github runners have docker 23.0
# - name: Validate docker build
# run: |
# cd $RUNNER_TEMP/src
# make docker-build