-
Notifications
You must be signed in to change notification settings - Fork 47
67 lines (56 loc) · 1.75 KB
/
verify.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
57
58
59
60
61
62
63
64
65
66
67
name: Verify
on: [push]
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.8
env:
POSTGRES_USER: "maglev"
POSTGRES_PASSWORD: "password"
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
node: [18]
gemfile: ["Gemfile.rails_6", "Gemfile.rails_7_0", "Gemfile"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Ruby and install gems using ${{ matrix.gemfile }}
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- name: Install packages
run: |
yarn install --pure-lockfile
- name: Setup test database
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
RAILS_ENV: test
MAGLEV_APP_DATABASE_USERNAME: "maglev"
MAGLEV_APP_DATABASE_PASSWORD: "password"
run: |
bin/rails db:setup
- name: Run Rails tests
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
MAGLEV_APP_DATABASE_USERNAME: "maglev"
MAGLEV_APP_DATABASE_PASSWORD: "password"
run: bundle exec rspec
- name: Run Javascript tests
run: yarn test
# NOTE: disabled because an error of eslint in the GH env
# - name: Run Javascript linter
# run: yarn lint