-
-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (99 loc) · 3.83 KB
/
lint.yml
File metadata and controls
121 lines (99 loc) · 3.83 KB
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
# Run linters
#
# Lint Rust code using cargo clippy, and GitHub Actions workflows using zizmor. Apply
# static analysis rules to catch common mistakes and improves code style.
name: Lint
on:
push:
branches: ["main"]
pull_request:
types: [opened, reopened, synchronize]
branches: ["main"]
permissions: {}
# Make sure CI fails on all warnings, including Clippy lints
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
jobs:
clippy_check:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run Clippy
run: cargo clippy --all-targets
docs_rs:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup rust toolchain, cache and cargo-docs-rs binary
uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2
with:
channel: nightly
bins: cargo-docs-rs
- name: Test docs.rs build
run: cargo docs-rs
format_check:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run Rustfmt
run: cargo fmt --check -- --config imports_granularity=Module,group_imports=StdExternalCrate
stubtest:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"
- name: Build wheels
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
with:
target: x86_64
args: --locked --features cuda,pyo3 --out dist --interpreter python3.13
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: "2_28"
before-script-linux: |
# Install nvTIFF and clang-devel
if command -v dnf &> /dev/null; then
# https://developer.nvidia.com/nvtiff-0-6-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Rocky&target_version=8&target_type=rpm_network
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/${{ matrix.platform.arch || 'x86_64' }}/cuda-rhel8.repo
dnf clean all
dnf install -y clang-devel cuda-crt-13-0 cuda-cudart-devel-13-0 nvtiff-cuda-13-0.6.0.* libnvtiff0-cuda-13-0.6.0.*
# Patch nvtiff.h (v0.6.0) to add missing enum tag
sed --in-place "s/nvtiffTagDataType type/enum nvtiffTagDataType type/g" /usr/include/nvtiff.h
fi
- name: Run mypy stubtest
run: |
set -e
python3 -m venv .venv
source .venv/bin/activate
pip install cog3pio --no-index --no-deps --find-links dist --force-reinstall -vv
pip install cog3pio --group tests
stubtest cog3pio --ignore-missing-stub --ignore-disjoint-bases
zizmor:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install zizmor
uses: taiki-e/install-action@42721ded7ddc3cd90f687527e8602066e4e1ff3a # v2.69.2
with:
tool: zizmor
- name: Run zizmor 🌈
run: zizmor --color=always .
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}