diff --git a/.github/workflows/check-demo-consistency.yml b/.github/workflows/check-demo-consistency.yml new file mode 100644 index 0000000000..a5dbc6d085 --- /dev/null +++ b/.github/workflows/check-demo-consistency.yml @@ -0,0 +1,32 @@ +# Fails if process-compose is edited but not docker-compose +name: Check Demo Consistency + +on: + pull_request: + paths: + - 'process-compose.yaml' + - 'docker-compose.yaml' + +jobs: + check-edits: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: Check for file edits + run: | + git fetch origin main + FILES_CHANGED=$(git diff --name-only origin/main..HEAD) + + # Check if process-compose.yaml is edited + if echo "$FILES_CHANGED" | grep "process-compose.yaml"; then + # Fail if docker-compose.yml is not also edited + if ! echo "$FILES_CHANGED" | grep "docker-compose.yaml"; then + echo "process-compose.yaml is edited but not docker-compose.yaml" + echo "If this was intentional, you may ignore this failure" + exit 1 + fi + fi diff --git a/process-compose.yaml b/process-compose.yaml index 96514d402a..036e2beb80 100644 --- a/process-compose.yaml +++ b/process-compose.yaml @@ -19,7 +19,7 @@ processes: exec: command: "[ $(docker inspect -f '{{.State.Health.Status}}' espresso-sequencer-demo-l1-network-1) = 'healthy' ]" initial_delay_seconds: 5 - period_seconds: 5 + period_seconds: 6 timeout_seconds: 5 success_threshold: 1 failure_threshold: 20