ci: Try add report for test results. #15
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: Wirdigen Workflow | |
on: [ push, pull_request ] | |
jobs: | |
wirdigen_cli: | |
name: Wirdigen CLI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install stable toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
components: rustfmt, clippy | |
- name: Install cargo2junit | |
run: cargo install cargo2junit | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Check formatting | |
uses: actions-rust-lang/rustfmt@v1 | |
with: | |
manifest-path: './Cargo.toml' | |
- name: Check sources | |
run: cargo check --release | |
- name: Run clippy | |
run: cargo clippy | |
- name: Build sources | |
run: cargo build --release | |
- name: Run tests | |
run: cargo test --release --format json | cargo2junit > results.xml | |
- name: Upload test results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
check_name: Test Results | |
files: results.xml | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wirdigen_cli | |
path: target/release/wirdigen | |
retention-days: 7 | |
wirdigen_wasm: | |
name: Wirdigen WASM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install stable toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Check formatting | |
uses: actions-rust-lang/rustfmt@v1 | |
with: | |
manifest-path: './wasm/Cargo.toml' | |
- name: Build sources | |
run: wasm-pack build ./wasm -t nodejs --out-name wirdigen_wasm --target-dir target | |
- name: Run tests | |
run: wasm-pack test --node --release ./wasm | |
- name: Pack NPM package | |
run: wasm-pack pack ./wasm | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wirdigen_wasm | |
path: wasm/pkg/*.tgz | |
retention-days: 7 |