NOSImage validation script #135
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: NOSImage validation script | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
schedule: | |
- cron: "49 0 * * *" | |
jobs: | |
integration-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: stable | |
cache: false | |
- name: Generate Examples and Check No Diff | |
run: | | |
cd tools/nosimage | |
go generate ./example | |
git diff --exit-code --ignore-all-space --ignore-blank-lines | |
- name: Validate Good Example | |
run: | | |
cd tools/nosimage | |
go run validate/validate.go -file example/valid_example_nosimageprofile.textproto; rm -rf tmp | |
- name: Validate Bad Example | |
run: | | |
cd tools/nosimage | |
for file in example/invalid-*.textproto; do | |
if go run validate/validate.go -file "$file"; then | |
echo "Validation passed for $file, but failure expected" | |
exit 1 | |
fi | |
done | |
rm -rf tmp |