chore(frontend): bump api #525
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: kuberunner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20.1' | |
- name: Install foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Build ethereum smart-contracts | |
run: forge build | |
working-directory: ./ethereum | |
- name: Build | |
run: cargo build --release --all-targets | |
lints: | |
runs-on: kuberunner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20.1' | |
- name: Install foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Build ethereum smart-contracts | |
run: forge build | |
working-directory: ./ethereum | |
- name: Run clippy | |
run: cargo clippy --release --all-targets -- -D warnings $(cat .lints | cut -f1 -d"#" | tr '\n' ' ') | |
- name: Run rustfmt | |
run: cargo fmt -- --check | |
tests: | |
runs-on: kuberunner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20.1' | |
- name: Install foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Build ethereum smart-contracts | |
run: forge build | |
working-directory: ./ethereum | |
- name: Run tests | |
run: cargo test --release --all-targets | |
- name: Run solidity tests | |
run: | | |
cd ethereum | |
forge test | |
check-api-files: | |
runs-on: kuberunner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20.1' | |
- name: Install foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly-4923529c743f25a0f37503a7bcf7c68caa6901f1 | |
- name: Build ethereum smart-contracts | |
run: forge build --force --no-cache | |
working-directory: ./ethereum | |
- name: Build workspace | |
run: cargo build --release --all-targets | |
- name: Check that files match | |
run: | | |
stored=( | |
"./api/ethereum/ERC20ManagerBridgingPayment.json" | |
"./api/ethereum/IERC20Manager.json" | |
"./api/ethereum/IMessageQueue.json" | |
"./api/gear/bridging_payment.idl" | |
"./api/gear/erc20_relay.idl" | |
"./api/gear/vft_manager.idl" | |
"./api/gear/wrapped_vara.idl" | |
"./api/gear/extended_vft.idl" | |
) | |
generated=( | |
"./ethereum/out/ERC20Manager.sol/ERC20ManagerBridgingPayment.json" | |
"./ethereum/out/IERC20Manager.sol/IERC20Manager.json" | |
"./ethereum/out/IMessageQueue.sol/IMessageQueue.json" | |
"./target/wasm32-unknown-unknown/release/bridging_payment.idl" | |
"./target/wasm32-unknown-unknown/release/erc20_relay.idl" | |
"./target/wasm32-unknown-unknown/release/vft_manager.idl" | |
"./target/wasm32-unknown-unknown/release/wrapped_vara.idl" | |
"./target/wasm32-unknown-unknown/release/extended_vft.idl" | |
) | |
for i in "${!stored[@]}"; do | |
if ! cmp -s "${stored[$i]}" "${generated[$i]}"; then | |
echo "API files ${stored[$i]} and ${generated[$i]} don't match." | |
diff "${stored[$i]}" "${generated[$i]}" | |
exit 1 | |
fi | |
done |