Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to '.github/workflows/build.yml')
| -rw-r--r-- | .github/workflows/build.yml | 121 |
1 files changed, 52 insertions, 69 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f9deeb9..deeff80e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,39 +4,31 @@ on: push: branches: - master - merge_group: schedule: - - cron: "00 01 * * *" - -env: - MSRV: "1.82" - # This key can be changed to bust the cache of tree-sitter grammars. - GRAMMAR_CACHE_VERSION: "" + - cron: '00 01 * * *' jobs: check: - name: Check (msrv) + name: Check runs-on: ubuntu-latest - if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule' + strategy: + matrix: + rust: [stable, msrv] steps: - name: Checkout sources - uses: actions/checkout@v5 + uses: actions/checkout@v3 - - name: Install MSRV toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.MSRV }} + - name: Use MSRV rust toolchain + if: matrix.rust == 'msrv' + run: cp .github/workflows/msrv-rust-toolchain.toml rust-toolchain.toml - - uses: Swatinem/rust-cache@v2 + - name: Install stable toolchain + uses: helix-editor/rust-toolchain@v1 with: - shared-key: "build" + profile: minimal + override: true - - name: Cache tree-sitter grammars - uses: actions/cache@v4 - with: - path: runtime/grammars - key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }} - restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars- + - uses: Swatinem/rust-cache@v2 - name: Run cargo check run: cargo check @@ -44,30 +36,27 @@ jobs: test: name: Test Suite runs-on: ${{ matrix.os }} - if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule' - timeout-minutes: 30 env: RUST_BACKTRACE: 1 HELIX_LOG_LEVEL: info steps: - name: Checkout sources - uses: actions/checkout@v5 + uses: actions/checkout@v3 - - name: Install MSRV toolchain - uses: dtolnay/rust-toolchain@master + - name: Install stable toolchain + uses: helix-editor/rust-toolchain@v1 with: - toolchain: ${{ env.MSRV }} + profile: minimal + override: true - uses: Swatinem/rust-cache@v2 - with: - shared-key: "build" - - name: Cache tree-sitter grammars - uses: actions/cache@v4 + - name: Cache test tree-sitter grammar + uses: actions/cache@v3 with: path: runtime/grammars - key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }} - restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars- + key: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }} + restore-keys: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars- - name: Run cargo test run: cargo test --workspace @@ -77,32 +66,23 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm] + os: [ubuntu-latest, macos-latest, windows-latest] lints: name: Lints runs-on: ubuntu-latest - if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule' steps: - name: Checkout sources - uses: actions/checkout@v5 + uses: actions/checkout@v3 - - name: Install MSRV toolchain - uses: dtolnay/rust-toolchain@master + - name: Install stable toolchain + uses: helix-editor/rust-toolchain@v1 with: - toolchain: ${{ env.MSRV }} + profile: minimal + override: true components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - with: - shared-key: "build" - - - name: Cache tree-sitter grammars - uses: actions/cache@v4 - with: - path: runtime/grammars - key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }} - restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars- - name: Run cargo fmt run: cargo fmt --all --check @@ -118,32 +98,17 @@ jobs: docs: name: Docs runs-on: ubuntu-latest - if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule' steps: - name: Checkout sources - uses: actions/checkout@v5 + uses: actions/checkout@v3 - - name: Install MSRV toolchain - uses: dtolnay/rust-toolchain@master + - name: Install stable toolchain + uses: helix-editor/rust-toolchain@v1 with: - toolchain: ${{ env.MSRV }} + profile: minimal + override: true - uses: Swatinem/rust-cache@v2 - with: - shared-key: "build" - - - name: Cache tree-sitter grammars - uses: actions/cache@v4 - with: - path: runtime/grammars - key: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }} - restore-keys: ${{ runner.os }}-${{ runner.arch }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars- - - - name: Validate queries - run: cargo xtask query-check - - - name: Validate themes - run: cargo xtask theme-check - name: Generate docs run: cargo xtask docgen @@ -154,3 +119,21 @@ jobs: git diff-files --quiet \ || (echo "Run 'cargo xtask docgen', commit the changes and push again" \ && exit 1) + + queries: + name: Tree-sitter queries + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: helix-editor/rust-toolchain@v1 + with: + profile: minimal + override: true + + - uses: Swatinem/rust-cache@v2 + + - name: Generate docs + run: cargo xtask query-check |