-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (62 loc) · 2.28 KB
/
Copy pathruby.yml
File metadata and controls
69 lines (62 loc) · 2.28 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Github Testing
on: [push, pull_request]
jobs:
test:
name: test (${{ matrix.os }})
env:
QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_COVERAGE_TOKEN }}
services:
postgres:
image: postgres:17
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: password
POSTGRES_USERNAME: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
# Read from .ruby-version instead of a second copy of the number here. CI used to be
# pinned to 3.0.3 while .ruby-version had been bumped to 3.4.9, so the suite stayed
# green on a Ruby the servers no longer ran and the breakage surfaced only on deploy.
ruby: ['.ruby-version']
runs-on: ${{ matrix.os }}
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
steps:
- uses: actions/checkout@v5
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: config bundler
run: |
bundle config set without 'development staging production'
bundle config set deployment '[secure]'
bundle env
head -n1 $(which bundle)
- name: Run Tests & generate coverage
env:
PG_DATABASE: postgres
PG_HOST: localhost
PG_USER: postgres
PG_PORT: ${{ job.services.postgres.ports[5432] }}
RAILS_ENV: test
COVERAGE: true
DISABLE_SPRING: 1
run: |
cp config/application-example.yml config/application.yml
cp config/database-travis.yml config/database.yml
bundle exec rake db:setup
bundle exec rails test test/*
# ------------------------------
# Qlty.sh integration
# ------------------------------
- name: Install qlty CLI
run: |
curl -LSs https://qlty.sh | bash
echo "${HOME}/.qlty/bin" >> $GITHUB_PATH
- name: Upload coverage to Qlty
if: env.QLTY_COVERAGE_TOKEN != ''
run: |
qlty coverage publish --report-format=simplecov coverage/.resultset.json