forked from jsonapi-serializer/jsonapi-serializer
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.29 KB
/
ci.yml
File metadata and controls
53 lines (43 loc) · 1.29 KB
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
name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [2.7, '3.0', 3.1, 3.2, 3.3, 3.4, head, truffleruby-head]
steps:
- uses: actions/checkout@v3
- name: Sets up the Ruby version
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Sets up the environment
run: |
sudo apt-get install libsqlite3-dev
- name: Install legacy bundler for Ruby 2.7
if: ${{ matrix.ruby == 2.7 }}
run: |
gem install -q bundler -v 2.4.22
- name: Install bundler 2.7+ for modern Rubies
if: ${{ matrix.ruby != 2.7 }}
run: |
gem install -q bundler
- name: Run bundle install
run: |
bundle install
- name: Runs code QA and tests
run: bundle exec rake
- name: Publish to Rubygems
continue-on-error: true
if: ${{ github.ref == 'refs/heads/master' }}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}