Skip to content

feat: Release version 1.0.0 - Production-ready stable release (#38) #171

feat: Release version 1.0.0 - Production-ready stable release (#38)

feat: Release version 1.0.0 - Production-ready stable release (#38) #171

Workflow file for this run

name: Build and Test
on:
push:
branches: [main, master]
tags:
- 'v*'
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check:
name: Check and Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check documentation
run: cargo doc --no-deps --all-features
- name: Check base build
run: cargo build --release
test:
name: Test
runs-on: ${{ matrix.os }}
needs: check
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: cargo test --verbose
- name: Run tests with CLI features
run: cargo test --features=cli --verbose
build:
name: Build Release Binaries
runs-on: ${{ matrix.os }}
needs: test
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: bbl_parser-linux-x64
binary_path: target/release/bbl_parser
- os: windows-latest
artifact_name: bbl_parser-windows-x64
binary_path: target/release/bbl_parser.exe
- os: macos-latest
artifact_name: bbl_parser-macos-x64
binary_path: target/release/bbl_parser
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build release binary
run: cargo build --release
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.binary_path }}
overwrite: true
if-no-files-found: error