-
Notifications
You must be signed in to change notification settings - Fork 19
179 lines (179 loc) · 5.33 KB
/
pr.yaml
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
173
174
175
176
177
178
179
on:
pull_request:
merge_group:
name: PR Checks
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
jobs:
check-licenses-readmes-match:
name: Check licenses match
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Copy LICENSE to editors/code directory
run: cp LICENSE editors/code/LICENSE
- name: Copy README.md to editors/code directory
run: cp README.md editors/code/README.md
- name: Check there is no change
run: git diff --quiet || exit 1
check-versions-match:
name: Check versions match
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install jq
- name: Allow running check_versions_match.sh
run: chmod +x ./.hacking/scripts/check_versions_match.sh
- run: ./.hacking/scripts/check_versions_match.sh
check:
name: Rust Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --all --all-features --tests --benches
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --locked --release --all-features
compile-wasm:
name: Compile wasm32-unknown-unknown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Add WASM target
run: rustup target add wasm32-unknown-unknown
- run: cargo build --package sqruff-lib --locked --release --target wasm32-unknown-unknown
typescript:
name: TypeScript
runs-on: ubuntu-latest
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: false
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- uses: dtolnay/rust-toolchain@nightly
- run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: cd playground && pnpm playwright install
- run: pnpm run ci
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- name: Run tests
run: cargo nextest run --locked --release
- name: Check for diffs
run: git diff --quiet || exit 1
test-cargo:
name: Cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- name: Run tests
run: cargo test
benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run benchmarks
run: cargo run --color=always --bin bench --manifest-path ./crates/cli/Cargo.toml
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: Swatinem/rust-cache@v2
- name: Checkout sources
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-machete
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Checkout sources
uses: actions/checkout@v4
- name: Run cargo clippy
run: cargo clippy --all --all-features -- -D warnings
- name: Check unused dependencies
run: cargo machete
- name: Cargo hack
run: cargo hack check --each-feature --exclude-features=codegen-docs
prettier-formatting:
name: Check Prettier formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run fmt:check
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: "./.hacking/scripts"
python:
name: Run python checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: make python_install
- run: make ci