Ruby CI #347
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: Ruby CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| release: | |
| types: | |
| - published | |
| schedule: | |
| - cron: "0 16 * * 0" # Every Sunday, 4 hours after midday | |
| permissions: | |
| contents: read | |
| jobs: | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| ruby-version: ["2.7", "3.0", "3.1", "3.2"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby ${{ matrix.ruby-version }} | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true | |
| - name: Run integration tests | |
| if: ${{ matrix.ruby-version == '3.2' && | |
| github.repository_owner == 'onfido' && | |
| (github.event_name == 'pull_request' || github.event_name == 'release') }} | |
| run: bundle exec rspec spec | |
| env: | |
| ONFIDO_API_TOKEN: ${{ secrets.ONFIDO_API_TOKEN }} | |
| ONFIDO_SAMPLE_APPLICANT_ID: ${{ secrets.ONFIDO_SAMPLE_APPLICANT_ID }} | |
| ONFIDO_SAMPLE_VIDEO_ID_1: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_1 }} | |
| ONFIDO_SAMPLE_VIDEO_ID_2: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_2 }} | |
| ONFIDO_SAMPLE_MOTION_ID_1: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_1 }} | |
| ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }} | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: integration-tests | |
| environment: delivery | |
| permissions: | |
| contents: write | |
| if: github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_ACTION_ACCESS_TOKEN }} | |
| ref: master | |
| - name: Set up Ruby 2.7 | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "2.7" | |
| - name: Validate release | |
| uses: onfido/onfido-actions/release-check@main | |
| - name: Publish to RubyGems | |
| run: | | |
| mkdir -p $HOME/.gem | |
| touch $HOME/.gem/credentials | |
| chmod 0600 $HOME/.gem/credentials | |
| printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | |
| gem build *.gemspec | |
| gem push *.gem | |
| env: | |
| GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" | |
| - name: Update and commit CHANGELOG.md | |
| uses: onfido/onfido-actions/update-changelog@main |