on aef00a3 help sign in
133 lines 3.1 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 docs:
107 name: Docs
108 runs-on: ubuntu-latest
109 steps:
110 - name: Checkout sources
111 uses: actions/checkout@v3
113 - name: Install stable toolchain
114 uses: helix-editor/rust-toolchain@v1
115 with:
116 profile: minimal
117 override: true
119 - uses: Swatinem/rust-cache@v1
121 - name: Generate docs
122 uses: actions-rs/cargo@v1
123 with:
124 command: xtask
125 args: docgen
127 - name: Check uncommitted documentation changes
128 run: |
129 git diff
130 git diff-files --quiet \
131 || (echo "Run 'cargo xtask docgen', commit the changes and push again" \
132 && exit 1)