-
Notifications
You must be signed in to change notification settings - Fork 20
67 lines (66 loc) · 2.43 KB
/
binding-checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Binding Checks
on:
pull_request:
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- # 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*'
- # Scripts that download external Candid files, with false positives.
'scripts/build.*.sh'
- # This workflow
'.github/workflows/binding-checks.yml'
- name: Build oisy-backend WASM
if: steps.changes.outputs.src == 'true'
uses: ./.github/actions/oisy-backend
- name: Prepare
if: steps.changes.outputs.src == 'true'
uses: ./.github/actions/prepare
- name: Install dfx
if: steps.changes.outputs.src == 'true'
uses: dfinity/setup-dfx@main
- name: Install binstall
if: steps.changes.outputs.src == 'true'
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
if: steps.changes.outputs.src == 'true'
run: cargo binstall --no-confirm [email protected] && candid-extractor --version
- name: Generate bindings
if: steps.changes.outputs.src == 'true'
run: npm run generate
- name: Check bindings
if: steps.changes.outputs.src == 'true'
run: |
test -z "$(git status --porcelain | tee /dev/stderr)" || {
echo "FIX: Please execute npm run generate"
git diff
exit 1
}
binding-checks-pass:
needs: [ 'generate' ]
runs-on: ubuntu-24.04
steps:
- name: Cleared for merging
run: echo OK