Refine minimal example controller tests #58
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: Run test and non-trunk build | |
on: | |
push: | |
branches: | |
- '*' | |
- '!main' | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
run: | |
name: Run tests | |
runs-on: [k8s-public] | |
timeout-minutes: 10 | |
container: golang:1 | |
env: | |
GOFLAGS: "-buildvcs=false" | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Lint/test | |
run: | | |
make test | |
build-controller: | |
runs-on: "ubuntu-latest" | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Docker Container | |
run: | | |
docker build -t test . | |
build-ca-gen: | |
runs-on: "ubuntu-latest" | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Docker Container | |
run: | | |
docker build -t test ./chiaca-generator/ | |
test-controller-gen-ran: | |
runs-on: "ubuntu-latest" | |
timeout-minutes: 10 | |
container: golang:1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for git diffs | |
shell: bash | |
run: | | |
git config --global --add safe.directory /__w/chia-operator/chia-operator | |
git diff | |
- name: Make manifests | |
run: make manifests | |
- name: Check for git diffs | |
shell: bash | |
run: | | |
git config --global --add safe.directory /__w/chia-operator/chia-operator | |
git diff | |
diff=$(git diff-index HEAD --) | |
dirs=(api config hack internal) | |
for dir in "${dirs[@]}"; do | |
if [[ "$diff" != *"${dir}"* ]]; then | |
echo "No uncommitted changes in .${dir}/" | |
else | |
echo "Uncommitted changes found .${dir}/ -- This may indicate that you made changes to the controller API but did not run \"make manifests\" before committing. Please see DEVELOPMENT.md" | |
echo "${diff}" | |
exit 1 | |
fi | |
done |