Repository navigation
Merge pull request #1092 from Shopify/vs_bump_minimum_rust #8015
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] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| 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@824c0e29fdfc7d689c191c27acc969d2d04b7dd8 # v1.331.0 | |
| with: | |
| bundler-cache: true | |
| - name: Lint | |
| run: bundle exec rake lint | |
| - name: Compile | |
| run: bundle exec rake compile | |
| - name: Check generated rules are up to date | |
| run: | | |
| changes=$(git status --porcelain lib/rubydex/rules) | |
| if [ -n "$changes" ]; then | |
| echo "$changes" | |
| echo "Generated rule classes are stale. Run \`bundle exec rake generate_rules\` and commit the result." | |
| exit 1 | |
| fi | |
| - name: Check generated C header is up to date | |
| run: | | |
| changes=$(git status --porcelain rust/rubydex-sys/rustbindings.h) | |
| if [ -n "$changes" ]; then | |
| echo "$changes" | |
| echo "Generated C header is stale. Run \`bundle exec rake compile\` and commit the result." | |
| exit 1 | |
| fi | |
| - name: Run Rubydex linter | |
| run: bundle exec rdx lint | |
| # Verify that licenses conform to the policy in rust/about.toml | |
| - name: Check licenses | |
| run: | | |
| cargo install cargo-about --features cli | |
| cargo about generate rust/about_templates --name about --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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: "recursive" | |
| - name: Install Rust tools | |
| run: | | |
| rustup update --no-self-update stable | |
| rustup default stable | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@824c0e29fdfc7d689c191c27acc969d2d04b7dd8 # v1.331.0 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Restore Rust compile cache | |
| id: rust-compile-cache-restore | |
| uses: actions/cache/restore@v6 | |
| 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@v6 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| rust/target | |
| key: ${{ steps.rust-compile-cache-restore.outputs.cache-primary-key }} |