fork/helix

git clone https://git.julia.blue/fork/helix

Michael DavisCI: Set a timeout for the test suite workflowbe1bf2f9

25.07
4.6 KiB156 linesraw
1name: Build
2on:
3  pull_request:
4  push:
5    branches:
6      - master
7  merge_group:
8  schedule:
9    - cron: "00 01 * * *"
10
11env:
12  MSRV: "1.82"
13  # This key can be changed to bust the cache of tree-sitter grammars.
14  GRAMMAR_CACHE_VERSION: ""
15
16jobs:
17  check:
18    name: Check (msrv)
19    runs-on: ubuntu-latest
20    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
21    steps:
22      - name: Checkout sources
23        uses: actions/checkout@v4
24
25      - name: Install MSRV toolchain
26        uses: dtolnay/rust-toolchain@master
27        with:
28          toolchain: ${{ env.MSRV }}
29
30      - uses: Swatinem/rust-cache@v2
31        with:
32          shared-key: "build"
33
34      - name: Cache tree-sitter grammars
35        uses: actions/cache@v4
36        with:
37          path: runtime/grammars
38          key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
39          restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
40
41      - name: Run cargo check
42        run: cargo check
43
44  test:
45    name: Test Suite
46    runs-on: ${{ matrix.os }}
47    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
48    timeout-minutes: 30
49    env:
50      RUST_BACKTRACE: 1
51      HELIX_LOG_LEVEL: info
52    steps:
53      - name: Checkout sources
54        uses: actions/checkout@v4
55
56      - name: Install MSRV toolchain
57        uses: dtolnay/rust-toolchain@master
58        with:
59          toolchain: ${{ env.MSRV }}
60
61      - uses: Swatinem/rust-cache@v2
62        with:
63          shared-key: "build"
64
65      - name: Cache tree-sitter grammars
66        uses: actions/cache@v4
67        with:
68          path: runtime/grammars
69          key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
70          restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
71
72      - name: Run cargo test
73        run: cargo test --workspace
74
75      - name: Run cargo integration-test
76        run: cargo integration-test
77
78    strategy:
79      matrix:
80        os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
81
82  lints:
83    name: Lints
84    runs-on: ubuntu-latest
85    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
86    steps:
87      - name: Checkout sources
88        uses: actions/checkout@v4
89
90      - name: Install MSRV toolchain
91        uses: dtolnay/rust-toolchain@master
92        with:
93          toolchain: ${{ env.MSRV }}
94          components: rustfmt, clippy
95
96      - uses: Swatinem/rust-cache@v2
97        with:
98          shared-key: "build"
99
100      - name: Cache tree-sitter grammars
101        uses: actions/cache@v4
102        with:
103          path: runtime/grammars
104          key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
105          restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
106
107      - name: Run cargo fmt
108        run: cargo fmt --all --check
109
110      - name: Run cargo clippy
111        run: cargo clippy --workspace --all-targets -- -D warnings
112
113      - name: Run cargo doc
114        run: cargo doc --no-deps --workspace --document-private-items
115        env:
116          RUSTDOCFLAGS: -D warnings
117
118  docs:
119    name: Docs
120    runs-on: ubuntu-latest
121    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
122    steps:
123      - name: Checkout sources
124        uses: actions/checkout@v4
125
126      - name: Install MSRV toolchain
127        uses: dtolnay/rust-toolchain@master
128        with:
129          toolchain: ${{ env.MSRV }}
130
131      - uses: Swatinem/rust-cache@v2
132        with:
133          shared-key: "build"
134
135      - name: Cache tree-sitter grammars
136        uses: actions/cache@v4
137        with:
138          path: runtime/grammars
139          key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
140          restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
141
142      - name: Validate queries
143        run: cargo xtask query-check
144
145      - name: Validate themes
146        run: cargo xtask theme-check
147
148      - name: Generate docs
149        run: cargo xtask docgen
150
151      - name: Check uncommitted documentation changes
152        run: |
153          git diff
154          git diff-files --quiet \
155            || (echo "Run 'cargo xtask docgen', commit the changes and push again" \
156            && exit 1)