chore: Allow partial configuration file #527
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
build: | |
name: Build & Test | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
--no-install-recommends \ | |
--allow-unauthenticated libgpgme-dev \ | |
libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-unknown-linux-gnu | |
components: rustfmt, clippy | |
- name: Cache Cargo dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Check the formatting | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: -- --check --verbose | |
- name: Build the project | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --locked --verbose | |
- name: Check the lints | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --tests --verbose -- -D warnings | |
- name: Prepare the test environment | |
shell: bash | |
run: ./prepare-test-env.sh | |
- 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 --features gpg-tests | |
- 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 | |
token: ${{secrets.CODECOV_TOKEN}} | |
lychee: | |
name: Links | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Check the links | |
uses: lycheeverse/lychee-action@v1 | |
with: | |
args: --exclude "discussions/new|twitter.com|patreon.com|aur.archlinux.org/(.+?).git|mailto:+|%7Buser%7D" -v *.md | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |