diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..ed8fcde --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,32 @@ +name: Check Specs & Metadata +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + validate: + name: Validate Manifest, Specs, & Models + runs-on: ubuntu-latest + env: + SCRIPT_DIR: .github/workflows + defaults: + run: + shell: bash + steps: + - name: Clone repo + uses: actions/checkout@v4 + - name: Install Java + uses: actions/setup-java@v4 + with: + distribution: adopt + java-version: 17 + - name: Download TLA⁺ dependencies + run: $SCRIPT_DIR/setup.sh + - name: Check models + run: $SCRIPT_DIR/wrapper.sh + + diff --git a/.github/workflows/setup.sh b/.github/workflows/setup.sh new file mode 100755 index 0000000..5b85999 --- /dev/null +++ b/.github/workflows/setup.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Get TLA⁺ tools +wget -nv http://nightly.tlapl.us/dist/tla2tools.jar -P "." diff --git a/.github/workflows/wrapper.sh b/.github/workflows/wrapper.sh new file mode 100755 index 0000000..f8619f0 --- /dev/null +++ b/.github/workflows/wrapper.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# A small wrapper around TLC +TLC_PATH=$1 + +TLC_COMMAND="java -Dtlc2.TLC.stopAfter=180 -Dtlc2.TLC.ide=Github -Dutil.ExecutionStatisticsCollector.id=abcdef60f238424fa70d124d0c77ffff -cp tla2tools.jar tlc2.TLC -workers auto -lncheck final -tool -deadlock" +find . -mindepth 1 -maxdepth 1 -type d '!' -exec test -e "{}/.ciignore" ';' -print | grep -v ".git" | xargs -n 1 "$TLC_COMMAND" + +