-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.09 KB
/
test.yaml
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
name: Run tests
on:
- push
- pull_request
permissions:
contents: read
pull-requests: write # coverage report
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: shiori
POSTGRES_PASSWORD: rootpass
POSTGRES_DB: shiori_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Run tests
run: |
bundle exec rails zeitwerk:check
bundle exec rails db:migrate
bundle exec rspec
- name: Report coverage
if: ${{ github.event_name == 'pull_request' }}
uses: romeovs/[email protected]
with:
lcov-file: ./coverage/lcov/shiori.lcov
filter-changed-files: true