fork/helix

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

Michael DavisCI: Use an env var for MSRV403aaa8c

25.01
3.3 KiB132 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.76"
13
14jobs:
15  check:
16    name: Check (msrv)
17    runs-on: ubuntu-latest
18    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
19    steps:
20      - name: Checkout sources
21        uses: actions/checkout@v4
22
23      - name: Install MSRV toolchain
24        uses: dtolnay/rust-toolchain@master
25        with:
26          toolchain: ${{ env.MSRV }}
27
28      - uses: Swatinem/rust-cache@v2
29        with:
30          shared-key: "build"
31
32      - name: Run cargo check
33        run: cargo check
34
35  test:
36    name: Test Suite
37    runs-on: ${{ matrix.os }}
38    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
39    env:
40      RUST_BACKTRACE: 1
41      HELIX_LOG_LEVEL: info
42    steps:
43      - name: Checkout sources
44        uses: actions/checkout@v4
45
46      - name: Install MSRV toolchain
47        uses: dtolnay/rust-toolchain@master
48        with:
49          toolchain: ${{ env.MSRV }}
50
51      - uses: Swatinem/rust-cache@v2
52        with:
53          shared-key: "build"
54
55      - name: Cache test tree-sitter grammar
56        uses: actions/cache@v4
57        with:
58          path: runtime/grammars
59          key: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
60          restore-keys: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-
61
62      - name: Run cargo test
63        run: cargo test --workspace
64
65      - name: Run cargo integration-test
66        run: cargo integration-test
67
68    strategy:
69      matrix:
70        os: [ubuntu-latest, macos-latest, windows-latest]
71
72  lints:
73    name: Lints
74    runs-on: ubuntu-latest
75    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
76    steps:
77      - name: Checkout sources
78        uses: actions/checkout@v4
79
80      - name: Install MSRV toolchain
81        uses: dtolnay/rust-toolchain@master
82        with:
83          toolchain: ${{ env.MSRV }}
84          components: rustfmt, clippy
85
86      - uses: Swatinem/rust-cache@v2
87        with:
88          shared-key: "build"
89
90      - name: Run cargo fmt
91        run: cargo fmt --all --check
92
93      - name: Run cargo clippy
94        run: cargo clippy --workspace --all-targets -- -D warnings
95
96      - name: Run cargo doc
97        run: cargo doc --no-deps --workspace --document-private-items
98        env:
99          RUSTDOCFLAGS: -D warnings
100
101  docs:
102    name: Docs
103    runs-on: ubuntu-latest
104    if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
105    steps:
106      - name: Checkout sources
107        uses: actions/checkout@v4
108
109      - name: Install MSRV toolchain
110        uses: dtolnay/rust-toolchain@master
111        with:
112          toolchain: ${{ env.MSRV }}
113
114      - uses: Swatinem/rust-cache@v2
115        with:
116          shared-key: "build"
117
118      - name: Validate queries
119        run: cargo xtask query-check
120
121      - name: Validate themes
122        run: cargo xtask theme-check
123
124      - name: Generate docs
125        run: cargo xtask docgen
126
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)