-
Notifications
You must be signed in to change notification settings - Fork 18
94 lines (85 loc) · 2.98 KB
/
Copy pathruby.yml
File metadata and controls
94 lines (85 loc) · 2.98 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Github Testing
on:
push:
branches: [master]
pull_request:
concurrency:
group: github-testing-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
test:
services:
postgres:
image: postgres:16
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]
ruby: ['3.0.3']
runs-on: ${{ matrix.os }}
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
env:
BUNDLE_WITHOUT: "development:staging:production"
BUNDLE_FROZEN: "true"
steps:
- uses: actions/checkout@v6
- name: Assert Ruby matches .ruby-version
run: |
expected=$(tr -d '[:space:]' < .ruby-version)
if [ "${{ matrix.ruby }}" != "$expected" ]; then
echo "CI ruby ${{ matrix.ruby }} does not match .ruby-version ($expected)"
exit 1
fi
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: Gemfile.lock
bundler-cache: true
- name: Verify gems match Gemfile.lock
run: |
bundle config set without 'development staging production'
bundle config set frozen true
bundle check
bundle env
bundle list
- name: Run Tests
env:
PG_DATABASE: postgres
PG_HOST: localhost
PG_USER: postgres
PG_PASSWORD: password
PG_PORT: ${{ job.services.postgres.ports[5432] }}
RAILS_ENV: test
COVERAGE: true
DISABLE_SPRING: 1
run: |
cp config/application.yml.sample config/application.yml
cp config/database_travis.yml config/database.yml
echo "openssl_config_path: 'test/fixtures/files/test_ca/openssl.cnf'" >> config/application.yml
echo "crl_dir: 'test/fixtures/files/test_ca/crl'" >> config/application.yml
echo "crl_path: 'test/fixtures/files/test_ca/crl/crl.pem'" >> config/application.yml
echo "ca_cert_path: 'test/fixtures/files/test_ca/certs/ca.crt.pem'" >> config/application.yml
echo "ca_key_path: 'test/fixtures/files/test_ca/private/ca.key.pem'" >> config/application.yml
echo "ca_key_password: 'password'" >> config/application.yml
bundle exec rake db:setup:all
bundle exec rails test test/*
- uses: qltysh/qlty-action/coverage@v2
if: github.event_name == 'push'
with:
token: ${{ secrets.QLTY_TOKEN }}
files: coverage/.resultset.json
- uses: actions/upload-artifact@v7
if: always()
with:
name: coverage
path: |
coverage/.resultset.json
coverage/index.html
coverage/assets/
include-hidden-files: true