Skip to content

feat: optimise release profile (#119) #59

feat: optimise release profile (#119)

feat: optimise release profile (#119) #59

Workflow file for this run

name: Build
on:
push:
branches: ["main"]
paths:
- "src/**"
- "tests/**"
- "examples/**"
- "*.toml"
- "codecov.yml"
pull_request:
branches: ["main"]
paths:
- "src/**"
- "tests/**"
- "examples/**"
- "*.toml"
- "codecov.yml"
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: baker
asset_name: baker-linux-amd64
- os: windows-latest
artifact_name: baker.exe
asset_name: baker-windows-amd64.exe
- os: macos-latest
artifact_name: baker
asset_name: baker-macos-amd64
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup cargo-tarpaulin
uses: taiki-e/install-action@cargo-tarpaulin
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo tarpaulin --out xml --verbose
env:
RUST_LOG: trace
- name: Run Gitea integration tests (Linux only)
if: matrix.os == 'ubuntu-latest'
run: cargo test --test gitea_integration_tests -- --ignored
env:
RUST_LOG: trace
- name: Upload reports to codecov
uses: codecov/codecov-action@v5
with:
name: code-coverage-report
file: cobertura.xml
flags: unit-tests
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build Release
run: cargo build --verbose --release