-
Notifications
You must be signed in to change notification settings - Fork 183
75 lines (68 loc) · 2.07 KB
/
main.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
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- spec_live
jobs:
test-and-lint:
name: Test and lint
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "jruby-9.4"
steps:
- name: Checkout code
uses: zendesk/checkout@v2
- name: Set up Ruby
uses: zendesk/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
- name: Custom cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}-${{ matrix.ruby }}
restore-keys: |
${{ runner.os }}-gems-${{ matrix.ruby }}
- name: Install gems
run: |
BUNDLE_GEMFILE=Gemfile.${{ matrix.ruby }} bundle install --jobs 4 --retry 3 --path vendor/bundle
- name: Test
run: |
BUNDLE_GEMFILE=Gemfile.${{ matrix.ruby }} bundle exec rake
- name: Lint
if: matrix.ruby == '2.7'
run: |
BUNDLE_GEMFILE=Gemfile.2.7 bundle exec rubocop
spec-live:
name: Spec live
if: github.repository == 'zendesk/zendesk_api_client_rb'
env:
SPEC_LIVE_USERNAME: ${{ secrets.SPEC_LIVE_USERNAME }}
SPEC_LIVE_PASSWORD: ${{ secrets.SPEC_LIVE_PASSWORD }}
SPEC_LIVE_ZENDESK_HOST: ${{ secrets.SPEC_LIVE_ZENDESK_HOST }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: zendesk/checkout@v2
- name: Set up Ruby
uses: zendesk/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.1
- name: spec:live
run: |
BUNDLE_GEMFILE=Gemfile.3.1 bundle install --jobs 4 --retry 3 --path vendor/bundle
BUNDLE_GEMFILE=Gemfile.3.1 bundle exec rake clean_live set_ci_credentials spec:live ||
BUNDLE_GEMFILE=Gemfile.3.1 bundle exec rake clean_live &&
BUNDLE_GEMFILE=Gemfile.3.1 bundle exec rspec spec/live --only-failures