Skip to content

chore: add lock file to .gitignore #823

chore: add lock file to .gitignore

chore: add lock file to .gitignore #823

Workflow file for this run

name: CI
on:
push:
branches: [master]
paths-ignore:
- '*.md'
- 'docs/**'
- 'LICENSE'
- '.github/workflows/docs.yml'
- '.github/workflows/nix.yml'
pull_request:
branches: [master, dev-openvpn]
paths-ignore:
- '*.md'
- 'docs/**'
- 'LICENSE'
- '.github/workflows/docs.yml'
- '.github/workflows/nix.yml'
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
format:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy Lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libdbus-1-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-clippy-
- run: cargo clippy --all-targets --all-features -- -D warnings
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libdbus-1-dev
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-test-
- name: Run unit tests
run: cargo test --lib --all-features --workspace
- name: Run doc tests
run: cargo test --doc --all-features --workspace
semver:
name: Semantic Versioning Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
# Prebuilt binary (GitHub Releases + checksums); avoids compiling the tool every run.
- uses: taiki-e/install-action@v2
with:
tool: cargo-semver-checks@0.47
fallback: none
# Smarter cache than hand-rolled keys; pairs well with semver-checks rustdoc builds.
- uses: Swatinem/rust-cache@v2
with:
shared-key: semver-checks
- name: Check semver compatibility
run: cargo semver-checks check-release -p nmrs
build:
name: Build (${{ matrix.target }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
packages: nmrs
- target: aarch64-unknown-linux-gnu
packages: nmrs
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libdbus-1-dev
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.target }}-
- name: Build ${{ matrix.packages }}
run: |
for package in ${{ matrix.packages }}; do
echo "Building $package for ${{ matrix.target }}"
cargo build --release --target ${{ matrix.target }} --package $package
done
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
PKG_CONFIG_ALLOW_CROSS: 1