-
-
Notifications
You must be signed in to change notification settings - Fork 32
95 lines (82 loc) · 2.44 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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@v4
- 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@v4
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
uses: taiki-e/install-action@cargo-tarpaulin
- name: Run tests
run: cargo tarpaulin --out xml --verbose --features gpg-tests
- name: Upload reports to codecov
uses: codecov/codecov-action@v4
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@v4
- name: Check the links
uses: lycheeverse/lychee-action@v2
with:
args: --exclude "discussions/new|twitter.com|patreon.com|aur.archlinux.org/(.+?).git|mailto:+|%7Buser%7D" -v *.md
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}