From 2c6cd53a2e36f2ad3514813d61dd482085ef786f Mon Sep 17 00:00:00 2001 From: Federico Ponzi Date: Sun, 11 Feb 2024 23:13:20 +0000 Subject: [PATCH] Adds CI - Fixes #1 --- .github/workflows/CI.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/setup.sh | 4 ++++ .github/workflows/wrapper.sh | 8 ++++++++ 3 files changed, 44 insertions(+) create mode 100644 .github/workflows/CI.yml create mode 100755 .github/workflows/setup.sh create mode 100755 .github/workflows/wrapper.sh 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..19c82e1 --- /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 -1 "$TLC_COMMAND" + +