chore: borsh update up to <1.6.0
(#34)
#23
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: | |
jobs: | |
msrv-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
- name: Get MSRV | |
run: | | |
RUST_MSRV="$(sed -n 's/rust-version *= *"\(.*\)"/\1/p' near-abi/Cargo.toml)" | |
echo "RUST_MSRV=$RUST_MSRV" >> $GITHUB_ENV | |
- name: "Install ${{ env.RUST_MSRV }} toolchain (MSRV)" | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ env.RUST_MSRV }} | |
default: true | |
- name: downgrade `toml_datetime` crate to support older Rust toolchain | |
if: ${{ env.RUST_MSRV }} == '1.66.0' | |
run: | | |
cargo update -p borsh --precise 1.1.0 | |
cargo update -p toml_edit --precise 0.20.2 | |
cargo update -p toml_datetime --precise 0.6.3 | |
- run: cargo check | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
- name: Run Tests | |
run: cargo test | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
- name: Check Formatting | |
run: cargo fmt -- --check | |
- name: Check Clippy | |
run: cargo clippy --tests -- -Dclippy::all | |
check-metaschema: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
- name: Install json-schema-compatibility-checker | |
run: | | |
wget https://github.com/itegulov/json-schema-compatibility-checker/releases/download/v0.1.0/jsonschemacompat_0.1.0_all.deb | |
sudo apt install ./jsonschemacompat_0.1.0_all.deb | |
- name: Generate Current ABI Meta-schema | |
run: cargo run --package metaschema-gen > tmp.json | |
- name: Check that Current Meta-schema is Up-to-date | |
run: diff tmp.json metaschema/near-abi-current-schema.json | |
- name: Check that Meta-schema is Backward Compatible | |
run: pip install semver && python .github/check_metaschema_compatibility.py | |
release-plz: | |
runs-on: ubuntu-latest | |
needs: [msrv-check, tests, lint, check-metaschema] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.MY_GITHUB_TOKEN }} | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Run release-plz | |
uses: MarcoIeni/release-plz-action@v0.5 | |
env: | |
# https://release-plz.ieni.dev/docs/github/trigger | |
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |