-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 2.2 KB
/
Copy pathci.yml
File metadata and controls
76 lines (68 loc) · 2.2 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
# Test gate on pushes and pull requests: Rust fmt/clippy/tests, the wire-level
# e2e script against the real binary, and a VS Code extension-host smoke test.
# The real game corpus runs in corpus.yml on schedule/manual/release only.
name: CI
on:
push:
branches: [dev, prod]
pull_request:
branches: [dev, prod]
workflow_call:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
# A newer push to the same ref supersedes in-flight runs; cancel them so we
# don't burn runner minutes on stale commits.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- name: cargo test
run: cargo test --locked
- name: e2e (stdio wire protocol)
shell: bash
run: |
cargo build --locked -p zerosyntax-server
bin=target/debug/zerosyntax-lsp
[ "$RUNNER_OS" = "Windows" ] && bin="$bin.exe"
# Linux runners expose the interpreter as `python3`; Windows as `python`.
if command -v python3 >/dev/null 2>&1; then py=python3; else py=python; fi
"$py" crates/server/tests/e2e.py "$bin"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- name: cargo fmt
run: cargo fmt --all --check
- name: cargo clippy
run: cargo clippy --locked --all-targets --all-features -- -D warnings
extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: editors/vscode/package-lock.json
- name: Build language server
run: cargo build --locked -p zerosyntax-server
- name: VS Code extension smoke
working-directory: editors/vscode
env:
ZEROSYNTAX_LSP_PATH: ${{ github.workspace }}/target/debug/zerosyntax-lsp
run: |
npm ci
xvfb-run -a npm test