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

119 lines
3.0 KiB
YAML
Raw Normal View History

name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * 0"
jobs:
check:
name: Check
2023-04-04 22:42:06 +03:00
runs-on: ubuntu-22.04
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout
uses: actions/checkout@v3
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --verbose
test:
name: Test suite
2023-04-04 22:42:06 +03:00
runs-on: ubuntu-22.04
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Checkout
if: github.event_name != 'pull_request'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup cargo-tarpaulin
run: |
curl -s https://api.github.com/repos/xd009642/tarpaulin/releases/latest | \
grep "browser_download_url.*x86_64-unknown-linux-musl.tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -qi -
tar -xzf cargo-tarpaulin-*.tar.gz
mv cargo-tarpaulin ~/.cargo/bin/
- name: Run tests
run: cargo tarpaulin --out Xml --verbose
- name: Upload reports to codecov
uses: codecov/codecov-action@v3
with:
name: code-coverage-report
file: cobertura.xml
flags: unit-tests
fail_ci_if_error: true
verbose: true
clippy:
name: Lints
2023-04-04 22:42:06 +03:00
runs-on: ubuntu-22.04
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Checkout
uses: actions/checkout@v3
- name: Check the lints
uses: actions-rs/cargo@v1
with:
command: clippy
2022-08-12 12:51:38 +03:00
args: --tests --verbose -- -D warnings
rustfmt:
name: Formatting
2023-04-04 22:42:06 +03:00
runs-on: ubuntu-22.04
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Checkout
uses: actions/checkout@v3
- name: Check the formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check --verbose
lychee:
name: Links
2023-04-04 22:42:06 +03:00
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check the links
uses: lycheeverse/lychee-action@v1
with:
args: >
--exclude "%7Busername%7D|file:///|https://datatracker.ietf.org|protonmail"
-v *.md docs/docs/* docs/blog/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
audit:
name: Audit check
2023-04-04 22:42:06 +03:00
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run cargo-audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}