forked from rubygems/rubygems.org
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (55 loc) · 1.74 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
permissions:
contents: read
jobs:
rails:
strategy:
fail-fast: false
matrix:
rubygems:
- name: locked
version: '3.4.12'
- name: latest
version: latest
ruby_version: ['3.2.2']
name: Rails tests (RubyGems ${{ matrix.rubygems.name }})
runs-on: ubuntu-22.04
env:
RUBYGEMS_VERSION: ${{ matrix.rubygems.version }}
# Fail hard when Toxiproxy is not running to ensure all tests (even Toxiproxy optional ones) are passing
REQUIRE_TOXIPROXY: true
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- 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@7d546f4868fb108ed378764d873683f920672ae2 # v1.149.0
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:all
- name: Upload coverage to Codecov
if: matrix.rubygems.name == 'locked' && (success() || failure())
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4