forked from fancy-regex/fancy-regex
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.25 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
# Based on https://github.com/actions-rs/meta/blob/master/recipes/msrv.md
name: ci
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '17 01 * * 0'
jobs:
check:
name: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo check
- run: cargo check --no-default-features
test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.66.1 # MSRV (minimum supported Rust version)
- stable
- beta
include:
- rust: 1.66.1
msrv: true
steps:
- uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
# See https://github.com/matklad/once_cell/issues/201
# To test locally, enable the lock file and then run:
# $ docker run --rm --user "$(id -u)":"$(id -g)" -v "$PWD":/usr/src/myapp -w /usr/src/myapp rust:1.66.1 cargo test
# To update, use `cargo +nightly update -Z minimal-versions` and then `cargo update -p bit-vec -p serde`
- name: Use Cargo.lock for MSRV
if: ${{ matrix.msrv }}
run: cp Cargo.lock.msrv Cargo.lock
- run: cargo test
example:
name: example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo run --example toy trace '\d*' '1122 33'
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
coverage:
if: ${{ github.event_name != 'schedule' }}
name: coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:0.31.2
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v4
- name: Generate code coverage
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true