Skip to content

feat(ci): Check that generated bindings are up to date #2

feat(ci): Check that generated bindings are up to date

feat(ci): Check that generated bindings are up to date #2

Workflow file for this run

name: Binding Checks
on:
pull_request:
paths:
- # Any new or changed canisters
'dfx.json'
- # Any new or changed .did files
'**/*.did'
- # Scripts, GitHub actions that contain 'backend' in their path.
'**/*backend*'
- # The backend source code
'src/backend/**'
- 'src/shared/**'
- # Rust files such as Cargo.lock, Cargo.toml and rust-toolchain.toml
'**/Cargo*'
- '**/*rust*'
- # This workflow
'.github/workflows/binding-checks.yml'
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-backend-tests-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Prepare
uses: ./.github/actions/prepare
- name: Generate bindings
run: npm run generate
# TODO: Cache the build.
- name: Check bindings
run: |
test -z "$(git status --porcelain)" || {
echo "FIX: Please run npm run generate"
git diff
exit 1
}
binding-checks-pass:
needs: [ 'generate' ]
runs-on: ubuntu-20.04
steps:
- name: Cleared for merging
run: echo OK