Skip to content

Commit

Permalink
Fail CI on stale generated code
Browse files Browse the repository at this point in the history
Closes: #10
  • Loading branch information
djbender committed Jan 24, 2023
1 parent 4d4a50d commit f08d399
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ env:
COMPOSE_DOCKER_CLI_BUILD: 1

jobs:
check-generated-code:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'dependencies') || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- run: bundle exec rake generate:all
- run: [[ $(git status --porcelain) ]] && exit 1
build-core-images:
runs-on: ubuntu-latest
needs:
- check-generated-code
if: contains(github.event.pull_request.labels.*.name, 'dependencies') || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
strategy:
# Build the core images first using the matrix strategy, from there, we will get a list
Expand All @@ -34,7 +42,7 @@ jobs:
# you must do so via a run step, vs the `env: ` workflow syntax. Additinally see
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#passing-values-between-steps-and-jobs-in-a-workflow
- name: set PWD environt variable
run: echo "PWD=$(pwd)" >> $GITHUB_ENV
run: echo "PWD=$(pwd)" >> $GITHUB_ENV

- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -69,6 +77,8 @@ jobs:
set-matrix:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'dependencies') || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs:
- check-generated-code
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
Expand Down

0 comments on commit f08d399

Please sign in to comment.