From 5f482fec057e4fb908d1ea9b728ea42e4213f0ca Mon Sep 17 00:00:00 2001 From: Davide Vacca Date: Mon, 3 Jun 2024 12:38:17 +0200 Subject: [PATCH] Add a few tests and update CHANGELOG and CI for delivery --- .github/workflows/gem-push.yml | 31 -------------- .github/workflows/ruby.yml | 75 +++++++++++++++++++++++----------- CHANGELOG.md | 3 +- 3 files changed, 53 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/gem-push.yml diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml deleted file mode 100644 index 7206d10..0000000 --- a/.github/workflows/gem-push.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Ruby Gem - -on: - release: - types: [published] - -jobs: - build: - name: Build + Publish - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby 2.6 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.6 - - - 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}}" diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 29347b9..b537e6b 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -1,35 +1,62 @@ -name: Ruby +name: Ruby CI on: push: - branches: [ master ] + branches: + - master pull_request: - branches: [ master ] + branches: + - master + workflow_dispatch: + release: + types: + - published jobs: - test: - + integration-tests: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.7', '3.0', '3.1', '3.2'] + ruby-version: ["2.7", "3.0", "3.1", "3.2"] steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true - - name: Run tests - if: ${{ matrix.ruby-version == '3.2' && - github.repository_owner == 'onfido' && - github.actor != 'dependabot[bot]' }} - 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 }} + - 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.actor != 'dependabot[bot]' }} + 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 + if: github.event_name == 'release' + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby 2.7 + uses: ruby/setup-ruby@v1 + with: + ruby-version: "2.7" + + - 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}}" diff --git a/CHANGELOG.md b/CHANGELOG.md index a4afb19..2f7c569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # Changelog -## v3.0.0 31th May 2024 +## v3.0.0 14th Jun 2024 - Make library auto-generated and based on [Onfido OpenAPI spec](https://github.com/onfido/onfido-openapi-spec) +- Refresh library up to commit: [3a077c7](https://github.com/onfido/onfido-openapi-spec/commit/3a077c7f8e51be8ba2ba6fa5c2f6d7e2ec9782bf) ## v2.9.0 24 November 2023