on aa00a47 help sign in
161 lines 3.8 kB history raw
1name: Build
2on:
3 pull_request:
4 push:
5 branches:
6 - master
7 schedule:
8 - cron: '00 01 * * *'
10jobs:
11 check:
12 name: Check
13 runs-on: ubuntu-latest
14 strategy:
15 matrix:
16 rust: [stable, msrv]
17 steps:
18 - name: Checkout sources
19 uses: actions/checkout@v3
21 - name: Use MSRV rust toolchain
22 if: matrix.rust == 'msrv'
23 run: cp .github/workflows/msrv-rust-toolchain.toml rust-toolchain.toml
25 - name: Install stable toolchain
26 uses: helix-editor/rust-toolchain@v1
27 with:
28 profile: minimal
29 override: true
31 - uses: Swatinem/rust-cache@v1
33 - name: Run cargo check
34 uses: actions-rs/cargo@v1
35 with:
36 command: check
38 test:
39 name: Test Suite
40 runs-on: ${{ matrix.os }}
41 env:
42 RUST_BACKTRACE: 1
43 HELIX_LOG_LEVEL: info
44 steps:
45 - name: Checkout sources
46 uses: actions/checkout@v3
48 - name: Install stable toolchain
49 uses: helix-editor/rust-toolchain@v1
50 with:
51 profile: minimal
52 override: true
54 - uses: Swatinem/rust-cache@v1
56 - name: Cache test tree-sitter grammar
57 uses: actions/cache@v3
58 with:
59 path: runtime/grammars
60 key: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
61 restore-keys: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-
63 - name: Run cargo test
64 uses: actions-rs/cargo@v1
65 with:
66 command: test
67 args: --workspace
69 - name: Run cargo integration-test
70 uses: actions-rs/cargo@v1
71 with:
72 command: integration-test
74 strategy:
75 matrix:
76 os: [ubuntu-latest, macos-latest, windows-latest]
78 lints:
79 name: Lints
80 runs-on: ubuntu-latest
81 steps:
82 - name: Checkout sources
83 uses: actions/checkout@v3
85 - name: Install stable toolchain
86 uses: helix-editor/rust-toolchain@v1
87 with:
88 profile: minimal
89 override: true
90 components: rustfmt, clippy
92 - uses: Swatinem/rust-cache@v1
94 - name: Run cargo fmt
95 uses: actions-rs/cargo@v1
96 with:
97 command: fmt
98 args: --all -- --check
100 - name: Run cargo clippy
101 uses: actions-rs/cargo@v1
102 with:
103 command: clippy
104 args: --all-targets -- -D warnings
106 - name: Run cargo doc
107 uses: actions-rs/cargo@v1
108 with:
109 command: doc
110 args: --no-deps --workspace --document-private-items
111 env:
112 RUSTDOCFLAGS: -D warnings
114 docs:
115 name: Docs
116 runs-on: ubuntu-latest
117 steps:
118 - name: Checkout sources
119 uses: actions/checkout@v3
121 - name: Install stable toolchain
122 uses: helix-editor/rust-toolchain@v1
123 with:
124 profile: minimal
125 override: true
127 - uses: Swatinem/rust-cache@v1
129 - name: Generate docs
130 uses: actions-rs/cargo@v1
131 with:
132 command: xtask
133 args: docgen
135 - name: Check uncommitted documentation changes
136 run: |
137 git diff
138 git diff-files --quiet \
139 || (echo "Run 'cargo xtask docgen', commit the changes and push again" \
140 && exit 1)
142 queries:
143 name: Tree-sitter queries
144 runs-on: ubuntu-latest
145 steps:
146 - name: Checkout sources
147 uses: actions/checkout@v3
149 - name: Install stable toolchain
150 uses: helix-editor/rust-toolchain@v1
151 with:
152 profile: minimal
153 override: true
155 - uses: Swatinem/rust-cache@v1
157 - name: Generate docs
158 uses: actions-rs/cargo@v1
159 with:
160 command: xtask
161 args: query-check