Skip to content

Commit

Permalink
Add new sensible pre-merge checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Starttoaster committed Dec 7, 2023
1 parent 65f5a0a commit 393eee6
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run test
name: Run test and non-trunk build

on:
push:
Expand All @@ -14,6 +14,7 @@ jobs:
run:
name: Run tests
runs-on: [k8s-public]
timeout-minutes: 10
container: golang:1
env:
GOFLAGS: "-buildvcs=false"
Expand All @@ -26,3 +27,56 @@ jobs:
- 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

0 comments on commit 393eee6

Please sign in to comment.