test ruby 4 #126
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: Release Ruby Gem | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| # trunk-ignore(checkov/CKV_GHA_7) | |
| release_tag: | |
| type: string | |
| description: Tag to create | |
| required: True | |
| workflow_call: | |
| inputs: | |
| release_tag: | |
| type: string | |
| description: Tag to create | |
| required: True | |
| push: | |
| branches: | |
| - max/ruby-4-support | |
| concurrency: ${{ github.workflow }} | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| ci-data: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| result: ${{ steps.fetch.outputs.result }} | |
| steps: | |
| - uses: oxidize-rb/actions/setup-ruby-and-rust@main | |
| with: | |
| rubygems: latest | |
| ruby-version: "4.0" | |
| bundler-cache: false | |
| cargo-cache: false | |
| cargo-vendor: false | |
| - uses: oxidize-rb/actions/fetch-ci-data@v1 | |
| id: fetch | |
| with: | |
| supported-ruby-platforms: | | |
| exclude: [arm-linux] | |
| stable-ruby-versions: | | |
| exclude: [head] | |
| cross-gem: | |
| name: Compile native gem for ${{ matrix.platform }} | |
| runs-on: ubuntu-latest | |
| needs: ci-data | |
| strategy: | |
| matrix: | |
| platform: | |
| - x86_64-linux | |
| - aarch64-linux | |
| - arm64-darwin | |
| - x86_64-darwin | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "4.0" | |
| bundler-cache: true | |
| working-directory: rspec-trunk-flaky-tests | |
| - name: Update CLI version | |
| uses: ./.github/actions/update_version | |
| if: "!cancelled()" | |
| with: | |
| version: ${{ github.event.inputs.release_tag || inputs.release_tag }} | |
| file: ./cli/Cargo.toml | |
| - name: Update Test Report version | |
| uses: ./.github/actions/update_version | |
| if: "!cancelled()" | |
| with: | |
| version: ${{ github.event.inputs.release_tag || inputs.release_tag }} | |
| file: ./test_report/Cargo.toml | |
| - name: Update Gem version | |
| uses: ./.github/actions/update_version | |
| if: "!cancelled()" | |
| with: | |
| version: ${{ github.event.inputs.release_tag || inputs.release_tag }} | |
| file: rspec-trunk-flaky-tests/rspec_trunk_flaky_tests.gemspec | |
| # this is necessary because the cross-gem action doesn't support reading the Gemfile.lock from the subdirectory | |
| # leading to a mismatch in the rb_sys version | |
| - name: Copy Gemfile.lock to root | |
| run: cp rspec-trunk-flaky-tests/Gemfile.lock ./Gemfile.lock | |
| shell: bash | |
| - uses: oxidize-rb/actions/cross-gem@v1 | |
| with: | |
| platform: ${{ matrix.platform }} | |
| working-directory: rspec-trunk-flaky-tests | |
| ruby-versions: 3.0,3.1,3.2,3.3,3.4,4.0 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cross-gem-${{ matrix.platform }} | |
| path: rspec-trunk-flaky-tests/pkg/*.gem | |
| if-no-files-found: error | |
| retention-days: 1 | |
| test-ruby-gem: | |
| name: Test Ruby Gem | |
| runs-on: ${{ matrix.platform.os }} | |
| needs: [ci-data, cross-gem] | |
| strategy: | |
| matrix: | |
| ruby-version: ["3.0", "3.1", "3.2", "3.3", "3.4", "4.0"] | |
| platform: | |
| - name: x86_64-linux | |
| os: ubuntu-latest | |
| - name: aarch64-linux | |
| os: ubuntu-24.04-arm | |
| - name: arm64-darwin | |
| os: macos-latest | |
| - name: x86_64-darwin | |
| os: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/test_ruby_gem_uploads | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} | |
| platform: ${{ matrix.platform.name }} | |
| artifact-pattern: cross-gem-${{ matrix.platform.name }} |