Merge pull request #855 from Linuus/expected-attributes #286
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: Main | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| matrix-test: | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.allow-failure || false }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-version: | |
| - "3.2" | |
| - "3.3" | |
| - "3.4" | |
| - "4.0" | |
| - "jruby-9.4" | |
| - "jruby" | |
| include: # HEAD-versions | |
| - ruby-version: "head" | |
| allow-failure: true | |
| - ruby-version: "jruby-head" | |
| allow-failure: true | |
| - ruby-version: "truffleruby-head" | |
| allow-failure: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| rubygems: latest | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true | |
| - name: Run tests | |
| run: bundle exec rspec | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| rubygems: latest | |
| ruby-version: "ruby" | |
| bundler-cache: true | |
| - name: Run tests | |
| run: bundle exec rspec | |
| env: | |
| COVERAGE: 1 | |
| - name: Upload coverage results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| include-hidden-files: true | |
| name: coverage-results | |
| path: coverage | |
| retention-days: 1 | |
| linting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| rubygems: default | |
| ruby-version: "ruby" | |
| bundler-cache: false | |
| - run: bundle install | |
| - name: Run standard | |
| run: bundle exec standardrb | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| rubygems: default | |
| ruby-version: "ruby" | |
| bundler-cache: false | |
| - run: bundle install | |
| - run: rake yard | |
| required-checks: | |
| runs-on: ubuntu-latest | |
| if: ${{ always() }} | |
| needs: | |
| - test | |
| - matrix-test | |
| - docs | |
| - linting | |
| steps: | |
| - name: failure | |
| if: ${{ failure() || contains(needs.*.result, 'failure') }} | |
| run: exit 1 | |
| - name: success | |
| run: exit 0 |