Skip to content

Commit

Permalink
workflow that fails if process compose is edited but docker compose i…
Browse files Browse the repository at this point in the history
…sn't
  • Loading branch information
nomaxg committed Mar 27, 2024
1 parent 2270088 commit a5d8125
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/check-demo-consistency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Fails if process-compose is edited but not docker-compose
name: Check Demo Consistency

on:
pull_request:
paths:
- 'process-compose.yaml'
- 'docker-compose.yml'

jobs:
check-edits:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Check for file edits
run: |
FILES_CHANGED=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
# Check if process-compose.yaml is edited
if echo "$FILES_CHANGED" | grep -q "process-compose.yaml"; then
# Fail if docker-compose.yml is not also edited
if ! echo "$FILES_CHANGED" | grep -q "docker-compose.yml"; then
echo "process-compose.yaml is edited but not docker-compose.yml"
exit 1
fi
fi
2 changes: 1 addition & 1 deletion process-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a5d8125

Please sign in to comment.