Skip to content

build(deps): bump the actions group across 1 directory with 2 updates #147

build(deps): bump the actions group across 1 directory with 2 updates

build(deps): bump the actions group across 1 directory with 2 updates #147

Workflow file for this run

name: Rust
on:
push:
branches: [main]
paths:
- crates/**/*.rs
- crates/**/Cargo.toml
- .github/workflows/rust.yml
tags:
- 'rf24-rs/*'
- 'rf24ble-rs/*'
# - 'rf24network-rs/*'
# - 'rf24mesh-rs/*'
pull_request:
branches: [main]
paths:
- crates/**/*.rs
- crates/**/Cargo.toml
- .github/workflows/rust.yml
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
permissions: {}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Rust
run: rustup update --no-self-update
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@bc432b49369a3f25c8c8b19578a82060c18a5dd6 # v1.17.6
- name: Install cargo-llvm-cov, cargo-nextest, and nur
env:
GITHUB_TOKEN: ${{ github.token }}
run: cargo binstall -y cargo-nextest cargo-llvm-cov nur
- name: Cache deps
uses: actions/cache@v5 # zizmor: ignore[cache-poisoning]
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-crates-${{ hashFiles('crates/*/src/**', 'crates/**/Cargo.toml') }}
- run: rustup component add llvm-tools-preview
# this enables a tool (for default toolchain) needed to measure code coverage.
- name: Run tests
run: nur test --profile ci
- name: Generate coverage reports
run: nur test lcov
- name: Upload coverage as artifact
uses: actions/upload-artifact@v7
with:
path: lcov.info
name: lcov.info
coverage:
needs: test
runs-on: ubuntu-latest
environment:
name: test-coverage
url: https://app.codecov.io/gh/nRF24/rf24-rs
steps:
- name: Download coverage artifact
uses: actions/download-artifact@v8
with:
name: lcov.info
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
if: github.repository == 'nRF24/rf24-rs'
id: codecov
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
publish:
name: Publish
runs-on: ubuntu-latest
if: startswith(github.ref, 'refs/tags/')
permissions:
# needed for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup nushell
uses: hustcer/setup-nu@92c296ba1ba2ba04cc948ab64ddefe192dc13f0c # v3.23
with:
version: ${{ vars.NU_SHELL_VERSION || '*' }}
- name: Get pkg from tag
id: pkg
shell: nu {0}
run: |-
let tag = $env.GITHUB_REF_NAME
let pkg = $tag | parse "{name}/{version}" | first
$"name=($pkg | get name)\n" | save --append $env.GITHUB_OUTPUT
- name: Install Rust
run: rustup update stable --no-self-update
- name: Establish provenance
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4
id: auth
- run: cargo publish -p ${PKG_NAME}
env:
PKG_NAME: ${{ steps.pkg.outputs.name }}
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}