Skip to content

Fix #228

Fix #228 #580

Workflow file for this run

on:
push:
tags-ignore:
- "*"
paths:
- ".github/workflows/ci.yml"
- ".github/workflows/anchore-analysis.yml"
- "Dockerfile"
- ".dockerignore"
- "Cargo.toml"
- "src/**"
- "tests/**"
pull_request:
paths:
- ".github/workflows/ci.yml"
- ".github/workflows/anchore-analysis.yml"
- "Dockerfile"
- ".dockerignore"
- "Cargo.toml"
- "src/**"
- "tests/**"
name: Build and Test
jobs:
minimum-version-check:
strategy:
matrix:
rust_toolchain: [1.78.0]
os: [ubuntu-latest, macOS-latest, windows-latest]
name: msrv check
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust
run: |
rustup update
rustup install ${{ matrix.rust_toolchain }}
- name: Check compilation with default features
run: |
cargo +${{ matrix.rust_toolchain }} check --all --bins --examples --tests
- name: Check compilation with no features
run: |
cargo +${{ matrix.rust_toolchain }} check --all --bins --examples --tests --no-default-features
compilation-check:
uses: anweiss/cddl/.github/workflows/compilation-check.yml@main
wasm-compilation-check:
strategy:
matrix:
rust_toolchain: [stable]
name: Compilation check for wasm target
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install Rust
run: |
rustup update
rustup install ${{ matrix.rust_toolchain }}
rustup target add wasm32-unknown-unknown
- name: Check compilation for wasm target
run: |
cargo +${{ matrix.rust_toolchain }} check --lib --target wasm32-unknown-unknown
test-suite:
strategy:
matrix:
rust_toolchain: [stable]
os: [ubuntu-latest, windows-latest]
name: Test suite
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install Rust
run: |
rustup update
rustup install ${{ matrix.rust_toolchain }}
rustup target add wasm32-unknown-unknown
- name: cargo +${{ matrix.rust_toolchain }} test ${{ matrix.os }}
run: |
cargo +${{ matrix.rust_toolchain }} test --all -- --nocapture
wasm-test-suite:
name: wasm test suite
runs-on: ubuntu-latest
if: contains(github.ref, 'vscode-extension') != true
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install Rust
run: |
rustup update
rustup target add wasm32-unknown-unknown
- name: Install wasmpack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
with:
node-version: "20"
- name: Build wasm
run: |
wasm-pack test --node -- --test wasm
style-linting:
strategy:
matrix:
rust_toolchain: [stable]
name: Style linting
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install Rust
run: |
rustup update
rustup install ${{ matrix.rust_toolchain }}
rustup component add rustfmt clippy
- name: cargo +${{ matrix.rust_toolchain }} fmt
if: ${{ always() }}
run: |
cargo +${{ matrix.rust_toolchain }} fmt --all -- --check
- name: cargo +${{ matrix.rust_toolchain }} clippy
if: ${{ always() }}
run: |
cargo +${{ matrix.rust_toolchain }} clippy --all
wasm-style-linting:
strategy:
matrix:
rust_toolchain: [stable]
name: wasm style linting
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install Rust
run: |
rustup update
rustup install ${{ matrix.rust_toolchain }}
rustup target add wasm32-unknown-unknown
rustup component add rustfmt clippy
- name: cargo +${{ matrix.rust_toolchain }} clippy
if: ${{ always() }}
run: |
cargo +${{ matrix.rust_toolchain }} clippy --lib --target wasm32-unknown-unknown