-
Notifications
You must be signed in to change notification settings - Fork 19
82 lines (78 loc) · 2.47 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
on:
push:
branches:
- main
pull_request:
branches:
- main
name: Continuous integration
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
rust: [beta, stable, 1.64.0]
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
# Skip cargo update for MSRV validation build
- run: cargo update
if: ${{ matrix.rust == 'stable' || matrix.rust == 'beta' }}
- name: Get latest CMake and ninja
uses: lukka/get-cmake@latest
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo test --all-features
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: clippy, rustfmt
- name: Get latest CMake and ninja
uses: lukka/get-cmake@latest
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo fmt --all -- --check
- run: cargo clippy --all -- -D warnings
- run: cargo check
- run: cargo check --package prost-reflect --no-default-features
- run: cargo check --package prost-reflect --no-default-features --features=text-format
- run: cargo check --package prost-reflect --no-default-features --features=serde
- run: cargo check --package prost-reflect --all-features
- name: Check README.md is up-to-date
shell: pwsh
run: |
./generate-readme.ps1
if (git diff README.md) {
Write-Error "README.md is out-of-date, run generate-readme.ps1 to regenerate it." -ErrorAction Stop
}
coverage:
name: Coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate code coverage
run: |
cargo tarpaulin --verbose --packages prost-reflect prost-reflect-tests --all-features --timeout 120 --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true