README Update #8
This file contains 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: ubuntu-latest | |
strategy: | |
matrix: | |
ruby-version: ['3.0', '3.1', '3.2'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
- name: Setup Bundler | |
run: | | |
gem install bundler | |
bundle config set --local path 'vendor/bundle' | |
bundle lock --add-platform x86_64-linux | |
bundle lock --add-platform ruby | |
bundle install --jobs 4 | |
- name: Run tests | |
run: bundle exec rake spec | |
env: | |
COVERAGE: true | |
DEEPSEEK_API_KEY: 'test-key' | |
- name: Publish code coverage | |
if: github.ref == 'refs/heads/main' && matrix.ruby-version == '3.2' | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageCommand: bundle exec rake spec | |
coverageLocations: ${{github.workspace}}/coverage/coverage.xml:cobertura | |
debug: true | |
- name: Upload coverage artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report-ruby-${{ matrix.ruby-version }} | |
path: coverage/ | |
retention-days: 14 | |
if-no-files-found: error |