Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to '.github/workflows/build.yml')
| -rw-r--r-- | .github/workflows/build.yml | 181 |
1 files changed, 82 insertions, 99 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f9deeb9..3d82c609 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,153 +4,136 @@ 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@v2 + with: + submodules: true + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true - - name: Install MSRV toolchain - uses: dtolnay/rust-toolchain@master + - name: Cache cargo registry + uses: actions/[email protected] with: - toolchain: ${{ env.MSRV }} + path: ~/.cargo/registry + key: ${{ runner.os }}-v1-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - uses: Swatinem/rust-cache@v2 + - name: Cache cargo index + uses: actions/[email protected] with: - shared-key: "build" + path: ~/.cargo/git + key: ${{ runner.os }}-v1-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Cache tree-sitter grammars - uses: actions/cache@v4 + - name: Cache cargo target dir + 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: target + key: ${{ runner.os }}-v1-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - 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@v2 + with: + submodules: true - - 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: ${{ matrix.rust }} + 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 }}-v1-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - 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 }}-v1-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Run cargo test - run: cargo test --workspace + - name: Cache cargo target dir + uses: actions/[email protected] + with: + path: target + key: ${{ runner.os }}-v1-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - name: Run cargo integration-test - run: cargo integration-test + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test 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@v2 + with: + submodules: true - - 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 }}-v1-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - 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: Run cargo fmt - run: cargo fmt --all --check + path: ~/.cargo/git + key: ${{ runner.os }}-v1-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - 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 - - 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 - - - name: Install MSRV toolchain - uses: dtolnay/rust-toolchain@master + - name: Cache cargo target dir + uses: actions/[email protected] with: - toolchain: ${{ env.MSRV }} + path: target + key: ${{ runner.os }}-v1-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - uses: Swatinem/rust-cache@v2 + - name: Run cargo fmt + uses: actions-rs/cargo@v1 with: - shared-key: "build" + command: fmt + args: --all -- --check - - name: Cache tree-sitter grammars - uses: actions/cache@v4 + - name: Run cargo clippy + uses: actions-rs/cargo@v1 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 - - - name: Check uncommitted documentation changes - run: | - git diff - git diff-files --quiet \ - || (echo "Run 'cargo xtask docgen', commit the changes and push again" \ - && exit 1) + command: clippy + args: -- -D warnings |