forked from rubygems/rubygems.org
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (56 loc) · 1.77 KB
/
test.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
name: Tests
on:
pull_request:
push:
branches:
- master
jobs:
rails:
strategy:
fail-fast: false
matrix:
rubygems_version: ['3.2.31', 'latest']
ruby_version: ['3.0.3']
name: Rails tests (Ruby ${{ matrix.ruby_version }}, RubyGems ${{ matrix.rubygems_version }})
runs-on: ubuntu-18.04
env:
RUBYGEMS_VERSION: ${{ matrix.rubygems_version }}
# If we don't supply a CC_TEST_REPORTER_ID simplecov won't output coverage in a way that
# code climate understands
CC_TEST_REPORTER_ID: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
# Fail hard when Toxiproxy is not running to ensure all tests (even Toxiproxy optional ones) are passing
REQUIRE_TOXIPROXY: true
steps:
- uses: actions/checkout@v2
- name: Install and start services
run: |
docker-compose up -d
- name: Wait for ES to boot
run: |
timeout 300 bash -c "until curl --silent --output /dev/null http://localhost:9200/_cat/health?h=st; do printf '.'; sleep 5; done; printf '\n'"
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: set rubygems version
run: |
if [ "$RUBYGEMS_VERSION" != "latest" ]; then
gem update --system $RUBYGEMS_VERSION;
else
gem update --system
fi
gem --version
bundle --version
- name: Prepare environment
run: |
cp config/database.yml.sample config/database.yml
bundle exec rake db:setup
- name: Tests
run: bin/rails test
- name: archive coverage
if: matrix.rubygems_version == '3.2.31'
uses: actions/upload-artifact@v2
with:
name: coverage
path: |
coverage