Skip to content

Commit

Permalink
Add cargo test dummy_issuer to CI (#25)
Browse files Browse the repository at this point in the history
# Motivation

Do not add breaking changes to dummy_issuer accidentally.

In this PR, I add the integration tests of the dummy_issuer to the CI.

# Changes

* New workflow "Rust" to build the wasm and execute the tests.

# Tests

Already running in the PR.

# Todos

- [ ] Add entry to changelog (if necessary). Not necessary.
  • Loading branch information
lmuntaner authored Jun 10, 2024
1 parent 839501e commit bba263f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Checks
name: JS Library Checks

on:
pull_request:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Cargo Tests

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
run: |
rustup component add rustfmt
rustup component add clippy
- name: Check Format
run: cargo fmt --all -- --check

# fails if lockfile is out of date
# https://users.rust-lang.org/t/check-if-the-cargo-lock-is-up-to-date-without-building-anything/91048/5
- name: Cargo Lockfile Check
run: cargo update --workspace --locked

- name: Install PocketIC
run: |
curl -sL -o pocket-ic.gz https://github.com/dfinity/pocketic/releases/download/4.0.0/pocket-ic-x86_64-linux.gz
gzip -d pocket-ic.gz
chmod +x pocket-ic
echo "POCKET_IC_BIN=$(pwd)/pocket-ic" >> $GITHUB_ENV
- name: Install ic-wasm
run: cargo install ic-wasm --version 0.3.5

- name: Build Wasm Dummy Issuer
working-directory: dummy-issuer
run: ./build.sh

# fails if lockfile is out of date
# https://users.rust-lang.org/t/check-if-the-cargo-lock-is-up-to-date-without-building-anything/91048/5
# Run only dummy_issuer to avoid building dummy_relying_party
- name: Cargo tests
run: cargo test --package dummy_issuer

0 comments on commit bba263f

Please sign in to comment.