1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-12-12 18:50:13 +03:00
git-cliff/.github/workflows/ci.yml

105 lines
2.7 KiB
YAML

name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check:
name: Check
runs-on: ubuntu-18.04
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Checkout
uses: actions/checkout@main
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --verbose
test:
name: Test suite
runs-on: ubuntu-18.04
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Run tests
run: |
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
export RUSTDOCFLAGS="-Cpanic=abort"
curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-linux-x86_64.tar.bz2 | tar jxf -
cargo test --verbose $CARGO_OPTIONS
zip -0 ccov.zip `find . \( -name "git_cliff*.gc*" \) -print`;
./grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info;
bash <(curl -s https://codecov.io/bash) -f lcov.info;
clippy:
name: Lints
runs-on: ubuntu-18.04
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: clippy
override: true
- name: Checkout
uses: actions/checkout@main
- name: Check the lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: --verbose -- -D warnings
rustfmt:
name: Formatting
runs-on: ubuntu-18.04
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true
- name: Checkout
uses: actions/checkout@main
- name: Check the formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check --verbose
lychee:
name: Links
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@main
- name: Check the links
uses: lycheeverse/lychee-action@v1
with:
args: --exclude "%7Busername%7D|file:///" -v *.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}