on 376c19e help sign in
110 lines 2.6 kB history raw
1name: Build
2on:
3 pull_request:
4 push:
5 branches:
6 - master
7 merge_group:
8 schedule:
9 - cron: '00 01 * * *'
11jobs:
12 check:
13 name: Check (msrv)
14 runs-on: ubuntu-latest
15 steps:
16 - name: Checkout sources
17 uses: actions/checkout@v3
18 - name: Install stable toolchain
19 uses: helix-editor/rust-toolchain@v1
20 with:
21 profile: minimal
22 override: true
24 - uses: Swatinem/rust-cache@v2
26 - name: Run cargo check
27 run: cargo check
29 test:
30 name: Test Suite
31 runs-on: ${{ matrix.os }}
32 env:
33 RUST_BACKTRACE: 1
34 HELIX_LOG_LEVEL: info
35 steps:
36 - name: Checkout sources
37 uses: actions/checkout@v3
39 - name: Install stable toolchain
40 uses: dtolnay/rust-toolchain@1.65
42 - uses: Swatinem/rust-cache@v2
44 - name: Cache test tree-sitter grammar
45 uses: actions/cache@v3
46 with:
47 path: runtime/grammars
48 key: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
49 restore-keys: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-
51 - name: Run cargo test
52 run: cargo test --workspace
54 - name: Run cargo integration-test
55 run: cargo integration-test
57 strategy:
58 matrix:
59 os: [ubuntu-latest, macos-latest, windows-latest]
61 lints:
62 name: Lints
63 runs-on: ubuntu-latest
64 steps:
65 - name: Checkout sources
66 uses: actions/checkout@v3
68 - name: Install stable toolchain
69 uses: dtolnay/rust-toolchain@1.65
70 with:
71 components: rustfmt, clippy
73 - uses: Swatinem/rust-cache@v2
75 - name: Run cargo fmt
76 run: cargo fmt --all --check
78 - name: Run cargo clippy
79 run: cargo clippy --workspace --all-targets -- -D warnings
81 - name: Run cargo doc
82 run: cargo doc --no-deps --workspace --document-private-items
83 env:
84 RUSTDOCFLAGS: -D warnings
86 docs:
87 name: Docs
88 runs-on: ubuntu-latest
89 steps:
90 - name: Checkout sources
91 uses: actions/checkout@v3
93 - name: Install stable toolchain
94 uses: dtolnay/rust-toolchain@1.65
96 - uses: Swatinem/rust-cache@v2
98 - name: Validate queries
99 run: cargo xtask query-check
101 - name: Generate docs
102 run: cargo xtask docgen
104 - name: Check uncommitted documentation changes
105 run: |
106 git diff
107 git diff-files --quiet \
108 || (echo "Run 'cargo xtask docgen', commit the changes and push again" \
109 && exit 1)