Skip to content

NPM Bump version

NPM Bump version #77

Workflow file for this run

name: Rust
on:
push:
branches:
- '**'
pull_request:
types: [closed]
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Caching objects
id: cache-objects
uses: actions/cache@v4
with:
path: |
~/.cargo
${{ github.workspace }}/target
key: ${{ runner.os }}-rust-objects
- name: pre-commit
run: |
pip install pre-commit
pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks
pre-commit run --all-files
- name: Build
run: cargo build
- name: Run tests
run: cargo test
- name: Code coverage
run: |
cargo install cargo-llvm-cov
# rustup component add llvm-tools-preview --toolchain stable-x86_64-unknown-linux-gnu
cargo llvm-cov
COVERAGE=$(cargo llvm-cov --json | jq -r '.data[0].totals.lines.percent')
if (( $(echo "$COVERAGE < 90" | bc -l) )); then
echo "❌ Code coverage is below 90% (Current: ${COVERAGE}%)"
exit 1
fi
# - name: Install Miri
# run: |
# rustup toolchain install nightly --component miri
# rustup override set nightly
# cargo miri setup
# - name: Test with Miri
# run: cargo miri test
release:
needs: build
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v4
- name: Caching objects
id: cache-objects
uses: actions/cache@v4
with:
path: |
~/.cargo
${{ github.workspace }}/target
key: ${{ runner.os }}-release-objects
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Install dependencies
run: npm ci
- name: Install cargo-release
run: cargo install cargo-release
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: npx semantic-release