fork/helix

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

Ryan MehriDon't run scheduled builds on forks (#9718)dfa5382c

24.03
3.1 KiB122 linesraw
1name: Build
2on:
3  pull_request:
4  push:
5    branches:
6      - master
7  merge_group:
8  schedule:
9    - cron: '00 01 * * *'
10
11jobs:
12  check:
13    name: Check (msrv)
14    runs-on: ubuntu-latest
15    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
16    steps:
17      - name: Checkout sources
18        uses: actions/checkout@v4
19      - name: Install stable toolchain
20        uses: helix-editor/rust-toolchain@v1
21        with:
22          profile: minimal
23          override: true
24
25      - uses: Swatinem/rust-cache@v2
26        with:
27          shared-key: "build"
28
29      - name: Run cargo check
30        run: cargo check
31
32  test:
33    name: Test Suite
34    runs-on: ${{ matrix.os }}
35    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
36    env:
37      RUST_BACKTRACE: 1
38      HELIX_LOG_LEVEL: info
39    steps:
40      - name: Checkout sources
41        uses: actions/checkout@v4
42
43      - name: Install stable toolchain
44        uses: dtolnay/rust-toolchain@1.70
45
46      - uses: Swatinem/rust-cache@v2
47        with:
48          shared-key: "build"
49
50      - name: Cache test tree-sitter grammar
51        uses: actions/cache@v4
52        with:
53          path: runtime/grammars
54          key: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
55          restore-keys: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-
56
57      - name: Run cargo test
58        run: cargo test --workspace
59
60      - name: Run cargo integration-test
61        run: cargo integration-test
62
63    strategy:
64      matrix:
65        os: [ubuntu-latest, macos-latest, windows-latest]
66
67  lints:
68    name: Lints
69    runs-on: ubuntu-latest
70    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
71    steps:
72      - name: Checkout sources
73        uses: actions/checkout@v4
74
75      - name: Install stable toolchain
76        uses: dtolnay/rust-toolchain@1.70
77        with:
78          components: rustfmt, clippy
79
80      - uses: Swatinem/rust-cache@v2
81        with:
82          shared-key: "build"
83
84      - name: Run cargo fmt
85        run: cargo fmt --all --check
86
87      - name: Run cargo clippy
88        run: cargo clippy --workspace --all-targets -- -D warnings
89
90      - name: Run cargo doc
91        run: cargo doc --no-deps --workspace --document-private-items
92        env:
93          RUSTDOCFLAGS: -D warnings
94
95  docs:
96    name: Docs
97    runs-on: ubuntu-latest
98    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
99    steps:
100      - name: Checkout sources
101        uses: actions/checkout@v4
102
103      - name: Install stable toolchain
104        uses: dtolnay/rust-toolchain@1.70
105
106      - uses: Swatinem/rust-cache@v2
107        with:
108          shared-key: "build"
109
110      - name: Validate queries
111        run: cargo xtask query-check
112
113      - name: Generate docs
114        run: cargo xtask docgen
115
116      - name: Check uncommitted documentation changes
117        run: |
118          git diff
119          git diff-files --quiet \
120            || (echo "Run 'cargo xtask docgen', commit the changes and push again" \
121            && exit 1)
122