build and release (#4) #23
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: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| ruby-version: ['3.2', '3.3', '3.4'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true | |
| - name: Run CI verification | |
| run: bundle exec rake ci | |
| env: | |
| BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: matrix.ruby-version == '3.4' && matrix.os == 'ubuntu-latest' | |
| with: | |
| files: ./coverage/.resultset.json | |
| fail_ci_if_error: false | |
| # Summary job that requires all matrix tests to pass | |
| # This is what branch protection will check | |
| ci-success: | |
| name: CI Success | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check test matrix success | |
| run: | | |
| if [ "${{ needs.test.result }}" != "success" ]; then | |
| echo "Test matrix failed" | |
| exit 1 | |
| fi | |
| echo "All tests passed!" |