Add incremental infrastructure #4118
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push, pull_request] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: "recursive" | |
| - name: Install Rust tools | |
| run: | | |
| rustup update --no-self-update stable | |
| rustup default stable | |
| rustup component add --toolchain stable clippy rustfmt | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@90be1154f987f4dc0fe0dd0feedac9e473aa4ba8 # v1.286.0 | |
| with: | |
| bundler-cache: true | |
| - name: Lint | |
| run: bundle exec rake lint | |
| # Verify that licenses conform to the policy in rust/about.toml | |
| - name: Check licenses | |
| run: | | |
| cargo install cargo-about | |
| cargo about generate rust/about.hbs --manifest-path rust/Cargo.toml --workspace > THIRD_PARTY_LICENSES.html | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| ruby: ["3.3", "3.4", "4.0"] | |
| runs-on: ${{ matrix.os }} | |
| name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: "recursive" | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@90be1154f987f4dc0fe0dd0feedac9e473aa4ba8 # v1.286.0 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Restore Rust compile cache | |
| id: rust-compile-cache-restore | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| rust/target | |
| key: ${{ runner.os }}-rust | |
| - name: Run Rust tests | |
| run: bundle exec rake cargo_test | |
| - name: Run Ruby tests | |
| run: bundle exec rake test | |
| - name: Save Rust compile cache | |
| id: rust-compile-cache-save | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| rust/target | |
| key: ${{ steps.rust-compile-cache-restore.outputs.cache-primary-key }} |