-
Notifications
You must be signed in to change notification settings - Fork 334
172 lines (137 loc) · 4.81 KB
/
contrib_checks.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: "Checks: Lints, Tests, Docs"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
PR_NUMBER:
required: false
type: string
default: ""
concurrency:
group: ${{ inputs.CONCURRENCY }}-checks
cancel-in-progress: true
env:
PYTHON_VERSION: "3.8"
# web_sys_unstable_apis is required to enable the web_sys clipboard API which egui_web uses
# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
RUSTFLAGS: --cfg=web_sys_unstable_apis --deny warnings
RUSTDOCFLAGS: --deny warnings
# Do *not* use sscache since on contributor ci we don't have access to the gcloud stored cache.
#RUSTC_WRAPPER: "sccache"
# Not only `sccache` cannot cache incremental builds, it's counter-productive to generate all
# these incremental artifacts when running on CI.
CARGO_INCREMENTAL: "0"
defaults:
run:
shell: bash
permissions:
contents: "read"
jobs:
py-lints:
name: Python lints (ruff, mypy, …)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.34.0
- name: Python format check
run: pixi run py-fmt-check
- name: Lint Python
run: pixi run py-lint
py-test-docs:
name: Test Python Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.34.0
environments: py-docs
- name: Build via mkdocs
shell: bash
run: |
pixi run -e py-docs mkdocs build --strict -f rerun_py/mkdocs.yml
no-codegen-changes:
name: Check if running codegen would produce any changes
runs-on: ubuntu-latest-16-cores
steps:
# Note: We explicitly don't override `ref` here. We need to see if changes would be made
# in a context where we have merged with main. Otherwise we might miss changes such as one
# PR introduces a new type and another PR changes the codegen.
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.34.0
- name: Codegen check
run: pixi run codegen --force --check
rs-lints:
name: Rust lints (fmt, check, clippy, tests, doc)
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.34.0
- name: Rust checks & tests
run: pixi run rs-check --skip individual_crates docs_slow
misc-rerun-lints:
name: Rerun lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.34.0
- name: Rerun lints
run: pixi run lint-rerun
- name: Toml format check
run: pixi run toml-fmt-check
- name: Check for too large files
run: pixi run check-large-files
- name: Check Python example thumbnails
run: pixi run ./scripts/ci/thumbnails.py check
spell-check:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling of entire workspace
uses: crate-ci/typos@v1.18.0
cpp-formatting:
name: C++ formatting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clang format on all relevant files
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: "16"
# Only check c/cpp/h/hpp (default checks also .proto and others)
include-regex: ^.*\.(c|cpp|h|hpp)$
cpp-tests:
name: C++ tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.34.0
environments: cpp
# TODO(emilk): make this work somehow. Right now this just results in
# > Compiler: GNU 12.3.0 (/__w/rerun/rerun/.pixi/env/bin/x86_64-conda-linux-gnu-c++)
# 😭
# - name: Build and run C++ tests with clang++
# run: |
# pixi run -e cpp cpp-clean
# RERUN_WERROR=ON RERUN_USE_ASAN=ON CXX=clang++ pixi run -e cpp cpp-build-all
# RERUN_WERROR=ON RERUN_USE_ASAN=ON CXX=clang++ pixi run -e cpp cpp-test
- name: Build and run C++ tests with g++
run: |
pixi run -e cpp cpp-clean
RERUN_WERROR=ON RERUN_USE_ASAN=ON LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp CXX=g++ pixi run -e cpp cpp-build-all
RERUN_WERROR=ON RERUN_USE_ASAN=ON LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp CXX=g++ pixi run -e cpp cpp-test