feat(backend): Add migration state #63
This file contains 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: 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-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache backend wasm | |
uses: actions/cache@v4 | |
id: backend-wasm-cache | |
with: | |
path: | | |
target/wasm32-unknown-unknown/release/backend.wasm | |
key: backend-wasm-${{ hashFiles('Cargo.toml', 'Cargo.lock', 'rust-toolchain.toml', 'src/backend/**/*', 'src/shared/**/*') }} | |
- name: Cache cargo dependencies | |
if: steps.backend-wasm-cache.outputs.cache-hit != 'true' | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-backend-tests-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} | |
- name: Remove the old Wasm to force a rebuild | |
if: steps.backend-wasm-cache.outputs.cache-hit != 'true' | |
run: rm -f target/wasm32-unknown-unknown/release/backend.wasm | |
- name: Prepare | |
uses: ./.github/actions/prepare | |
- name: Install dfx | |
uses: dfinity/setup-dfx@main | |
- name: Install binstall | |
run: | | |
BINSTALL_VERSION="1.8.0" | |
curl -L --proto '=https' --tlsv1.2 -sSf "https://github.com/cargo-bins/cargo-binstall/releases/download/v${BINSTALL_VERSION}/cargo-binstall-x86_64-unknown-linux-musl.tgz" | tar -xvzf - cargo-binstall | |
./cargo-binstall -y --force "cargo-binstall@$BINSTALL_VERSION" | |
rm cargo-binstall | |
- name: Install candid-extractor | |
run: cargo binstall --no-confirm [email protected] && candid-extractor --version | |
- name: Generate bindings | |
run: npm run generate | |
- name: Check bindings | |
run: | | |
test -z "$(git status --porcelain)" || { | |
echo "FIX: Please execute 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 |