-
-
Notifications
You must be signed in to change notification settings - Fork 199
106 lines (99 loc) · 3.45 KB
/
ci.yml
File metadata and controls
106 lines (99 loc) · 3.45 KB
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
96
97
98
99
100
101
102
103
104
105
106
name: CI
on:
repository_dispatch:
workflow_dispatch:
push:
branches:
- master
tags:
- "*.*.*"
pull_request:
types:
- opened
- synchronize
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
jobs:
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: crate-ci/typos@v1.44.0
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- name: Compile
run: cargo check --locked
- name: Test
run: make test
# Verify shell completions can be generated without errors
- name: Check shell completions can be generated
run: |
./target/debug/lychee --generate complete-bash > /dev/null
./target/debug/lychee --generate complete-zsh > /dev/null
./target/debug/lychee --generate complete-fish > /dev/null
./target/debug/lychee --generate complete-elvish > /dev/null
./target/debug/lychee --generate complete-powershell > /dev/null
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Run cargo fmt (check if all code is rustfmt-ed)
run: cargo fmt --all --check
- name: Run cargo clippy (deny warnings)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check rustdoc warnings (temporarily allow warnings)
run: cargo doc --workspace --no-deps
continue-on-error: true # remove this after warnings are fixed
- uses: cargo-bins/cargo-binstall@main
- name: Install cargo-msrv
run: cargo binstall --no-confirm --force cargo-msrv
- name: Check cargo-msrv version
run: cargo msrv --version
- name: Verify the MSRV
run: make verify
publish-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: cargo fetch
run: cargo fetch
- name: cargo publish lychee-lib
run: cargo publish --dry-run --manifest-path lychee-lib/Cargo.toml
# Can't check lychee binary as it depends on the lib above
# and `--dry-run` doesn't allow unpublished crates yet.
# https://github.com/rust-lang/cargo/issues/1169
# `cargo-publish-all` is a solution but it doesn't work with
# Rust edition 2021.
# Therefore skip the check for now, which is probably fine
# because the binary is just a small wrapper around the CLI
# anyway.
#
# - name: cargo publish lychee
# uses: actions-rs/cargo@v1
# with:
# command: publish
# args: --dry-run --manifest-path lychee-bin/Cargo.toml
check-feature-flags:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Check that lychee doesn't depend on OpenSSL
run: test -z "$( cargo tree --package lychee --no-default-features --prefix none | sed -n '/^openssl-sys /p' )"
- name: Run cargo check with default features
run: cargo check --workspace --all-targets
- name: Run cargo check with all features
run: cargo check --workspace --all-targets --all-features