-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (41 loc) · 1.13 KB
/
test.yml
File metadata and controls
50 lines (41 loc) · 1.13 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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: hackorum_test
ports: ["5432:5432"]
options: >-
--health-cmd="pg_isready -U postgres -d hackorum_test"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/hackorum_test
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y build-essential libpq-dev pkg-config nodejs npm
NPM_CONFIG_PRODUCTION=false npm ci --production=false
npm run build:css
- name: Prepare database
run: bin/rails db:prepare
- name: Run specs
run: bundle exec rspec