chore: add additional tests (#11) #41
This file contains hidden or 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: Check Compose Files Sync | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'on-prem/templates/**' | |
| - 'on-prem/scripts/generate-compose.sh' | |
| - 'on-prem/scripts/sync-templates.sh' | |
| - 'on-prem/docker-compose.full.yml' | |
| - 'on-prem/docker-compose.database.yml' | |
| - 'on-prem/docker-compose.cache.yml' | |
| pull_request: | |
| paths: | |
| - 'on-prem/templates/**' | |
| - 'on-prem/scripts/generate-compose.sh' | |
| - 'on-prem/scripts/sync-templates.sh' | |
| - 'on-prem/docker-compose.full.yml' | |
| - 'on-prem/docker-compose.database.yml' | |
| - 'on-prem/docker-compose.cache.yml' | |
| jobs: | |
| check-sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install yq | |
| uses: mikefarah/yq@v4 | |
| - name: Generate compose files | |
| working-directory: on-prem | |
| run: ./scripts/sync-templates.sh | |
| - name: Check for differences | |
| working-directory: on-prem | |
| run: | | |
| if ! git diff --exit-code docker-compose.full.yml docker-compose.database.yml docker-compose.cache.yml; then | |
| echo "" | |
| echo "❌ Generated compose files are out of sync with committed files!" | |
| echo "" | |
| echo "To fix this, run and commit the changes:" | |
| echo " cd on-prem && ./scripts/sync-templates.sh" | |
| exit 1 | |
| fi | |
| echo "✅ All compose files are in sync" |