-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.33 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
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
95
96
97
name: Run tests
on:
push:
branches: [main]
paths-ignore: ['docs/**']
pull_request:
branches: [main]
paths-ignore: ['docs/**']
jobs:
test-ruby:
env:
RAILS_ENV: test
JWT_SECRET: "fake-but-ok"
name: Rails tests
runs-on: ubuntu-latest
# container: ubuntu:latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: db_pass
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Install build dependencies
run: |
sudo apt-get -y install libpq-dev
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.1'
bundler-cache: true
# Increment to force re-installation of the gems.
cache-version: 1
- name: Setup database and create credentials
env:
POSTGRES_DB: ct-vis-test
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: db_pass
POSTGRES_USER: postgres
run: |
bin/rails db:create
bin/rails db:schema:load
EDITOR=cat ./bin/rails credentials:edit
./bin/rails encryption:generate
- name: Run rails tests
env:
POSTGRES_DB: ct-vis-test
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: db_pass
POSTGRES_USER: postgres
# FSR running ./bin/bundle exec rspec does not work; it complains about
# incompatible library versions. However, ./bin/rails spec works just
# fine. :shrug:.
run:
./bin/rails spec
test-javascript:
name: JavaScript tests
runs-on: ubuntu-latest
# container: ubuntu:latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'yarn'
- name: Install JavaScript testing dependencies
run: yarn install --frozen-lockfile
- name: Run JavaScript tests
run:
yarn run jest --all
check-dockerfile:
name: Check Dockerfile builds
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run docker build
run: docker build .