-
Notifications
You must be signed in to change notification settings - Fork 17
62 lines (57 loc) · 1.8 KB
/
ruby.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Ruby CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
release:
types:
- published
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.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}}"