Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to '.github/workflows/build.yml')
| -rw-r--r-- | .github/workflows/build.yml | 202 |
1 files changed, 124 insertions, 78 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f9deeb9..be954774 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,149 +4,194 @@ 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' 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: actions-rs/toolchain@v1 with: - toolchain: ${{ env.MSRV }} + profile: minimal + toolchain: stable + override: true - - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/[email protected] with: - shared-key: "build" + path: ~/.cargo/registry + key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-registry- - - name: Cache tree-sitter grammars - uses: actions/cache@v4 + - name: Cache cargo index + uses: actions/[email protected] 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- + path: ~/.cargo/git + key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-index- + + - name: Cache cargo target dir + uses: actions/[email protected] + with: + path: target + key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-build-target- - name: Run cargo check - run: cargo check + uses: actions-rs/cargo@v1 + with: + command: check 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 stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + + - name: Cache cargo registry + uses: actions/[email protected] + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-registry- - - name: Install MSRV toolchain - uses: dtolnay/rust-toolchain@master + - name: Cache cargo index + uses: actions/[email protected] with: - toolchain: ${{ env.MSRV }} + path: ~/.cargo/git + key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-index- - - uses: Swatinem/rust-cache@v2 + - name: Cache cargo target dir + uses: actions/[email protected] with: - shared-key: "build" + path: target + key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-build-target- - - name: Cache tree-sitter grammars - uses: actions/cache@v4 + - name: Copy minimal languages config + run: cp .github/workflows/languages.toml ./languages.toml + + - name: Cache test tree-sitter grammar + uses: actions/[email protected] 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 }}-v2-tree-sitter-grammars-${{ hashFiles('languages.toml') }} + restore-keys: ${{ runner.os }}-v2-tree-sitter-grammars- - name: Run cargo test - run: cargo test --workspace - - - name: Run cargo integration-test - run: cargo integration-test + uses: actions-rs/cargo@v1 + with: + command: test + args: --workspace strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm] + os: [ubuntu-latest, macos-latest, windows-latest] + rust: [stable] 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: actions-rs/toolchain@v1 with: - toolchain: ${{ env.MSRV }} + profile: minimal + toolchain: stable + override: true components: rustfmt, clippy - - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/[email protected] with: - shared-key: "build" + path: ~/.cargo/registry + key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-registry- - - name: Cache tree-sitter grammars - uses: actions/cache@v4 + - name: Cache cargo index + uses: actions/[email protected] 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- + path: ~/.cargo/git + key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-index- + + - name: Cache cargo target dir + uses: actions/[email protected] + with: + path: target + key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-build-target- - name: Run cargo fmt - run: cargo fmt --all --check + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check - name: Run cargo clippy - run: cargo clippy --workspace --all-targets -- -D warnings - - - name: Run cargo doc - run: cargo doc --no-deps --workspace --document-private-items - env: - RUSTDOCFLAGS: -D warnings + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-targets -- -D warnings 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: actions-rs/toolchain@v1 with: - toolchain: ${{ env.MSRV }} + profile: minimal + toolchain: stable + override: true - - uses: Swatinem/rust-cache@v2 + - name: Cache cargo registry + uses: actions/[email protected] with: - shared-key: "build" + path: ~/.cargo/registry + key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-registry- - - name: Cache tree-sitter grammars - uses: actions/cache@v4 + - name: Cache cargo index + uses: actions/[email protected] 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 + path: ~/.cargo/git + key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-index- - - name: Validate themes - run: cargo xtask theme-check + - name: Cache cargo target dir + uses: actions/[email protected] + with: + path: target + key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-v2-cargo-build-target- - name: Generate docs - run: cargo xtask docgen + uses: actions-rs/cargo@v1 + with: + command: xtask + args: docgen - name: Check uncommitted documentation changes run: | @@ -154,3 +199,4 @@ jobs: git diff-files --quiet \ || (echo "Run 'cargo xtask docgen', commit the changes and push again" \ && exit 1) + |