107 lines (84 loc) · 2.88 KB
/
rust_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
96
97
98
99
100
101
102
103
104
105
106
107
name: Rust CI
on:
push:
paths:
- '.github/workflows/rust_ci.yml'
- 'dart-api-dl/**'
- 'dart-api-dl-sys/**'
- 'dart-src'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
RUST_NIGHTLY: nightly-2022-09-22
RUST_WORKSPACE: ${{ github.workspace }}/
RUSTFLAGS: "-D warnings"
DISABLE_AUTO_DART_FFIGEN: 1
jobs:
cargo-format:
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Install rust toolchain
working-directory: ${{ env.RUST_WORKSPACE }}
run: rustup toolchain install ${{ env.RUST_NIGHTLY }} --component rustfmt
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0
- name: cargo fmt
working-directory: ${{ env.RUST_WORKSPACE }}
run: cargo +${{ env.RUST_NIGHTLY }} fmt --all -- --check
cargo-sort:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Install cargo-sort
uses: ./.ci/install-cargo-sort
- name: cargo sort
run: cargo sort --grouped --workspace --check
cargo-clippy:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Install rust toolchain
working-directory: ${{ env.RUST_WORKSPACE }}
run: rustup show
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0
- name: cargo clippy
working-directory: ${{ env.RUST_WORKSPACE }}
run: cargo clippy --all-targets -- --deny warnings
cargo-test:
timeout-minutes: 20
strategy:
matrix:
os:
- ubuntu-20.04
- macos-11
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Install rust toolchain
working-directory: ${{ env.RUST_WORKSPACE }}
run: rustup show
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0
- name: Run tests
working-directory: ${{ env.RUST_WORKSPACE }}
run: |
cargo test --all-targets --quiet
cargo test --doc --quiet
cargo-doc:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Install rust toolchain
working-directory: ${{ env.RUST_WORKSPACE }}
run: rustup show
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0
- name: cargo doc
working-directory: ${{ env.RUST_WORKSPACE }}
run: cargo doc --all-features --no-deps --document-private-items