-
-
Notifications
You must be signed in to change notification settings - Fork 6
154 lines (133 loc) · 4.64 KB
/
y-octo.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Lint & Test & Fuzzing
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
# Cancels all previous workflow runs for pull requests that have not completed.
# See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# The concurrency group contains the workflow name and the branch name for
# pull requests or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: nightly-2023-08-19
components: clippy, rustfmt
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"
- name: Install Node.js dependencies
run: yarn install
- name: Install required cargo components
uses: taiki-e/install-action@v2
with:
tool: clippy-sarif,sarif-fmt
- name: Build & Check
run: |
cargo vendor > .cargo/config
cargo clippy --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
RUSTDOCFLAGS="-D rustdoc::broken-intra-doc-links" cargo doc --workspace --all-features --no-deps
env:
CARGO_TERM_COLOR: always
- name: Format check
run: |
yarn prettier --check .
yarn taplo fmt --check .
cargo +nightly-2023-08-19 fmt --all --check
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true
test:
name: test & collect coverage
runs-on: ubuntu-latest
continue-on-error: true
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
components: llvm-tools-preview
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Collect coverage data
run: cargo llvm-cov nextest --lcov --output-path lcov.info
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v3
with:
name: tests
files: lcov.info
loom:
name: loom thread test
runs-on: ubuntu-latest
continue-on-error: true
env:
RUSTFLAGS: --cfg loom
RUST_BACKTRACE: full
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: ./.github/actions/setup-rust
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
- name: Loom Thread Test
run: |
cargo nextest run -p y-octo --lib
fuzzing:
name: fuzzing
runs-on: ubuntu-latest
continue-on-error: true
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: nightly-2023-08-19
- name: fuzzing
working-directory: ./y-octo
run: |
cargo install cargo-fuzz
cargo +nightly-2023-08-19 fuzz run apply_update -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run codec_doc_any_struct -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run codec_doc_any -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run decode_bytes -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run i32_decode -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run i32_encode -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run ins_del_text -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run sync_message -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run u64_decode -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run u64_encode -- -max_total_time=30
cargo +nightly-2023-08-19 fuzz run apply_update -- -max_total_time=30
- name: upload fuzz artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: fuzz-artifact
path: ./y-octo/fuzz/artifacts/**/*