-
Notifications
You must be signed in to change notification settings - Fork 21
43 lines (39 loc) · 1.14 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: ruby_au
POSTGRES_PASSWORD: ruby_au
POSTGRES_DB: ruby_au_test
ports:
- 5432/tcp
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.5
bundler-cache: true
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 22.11.0
cache: "yarn"
- name: Install Yarn dependencies
run: |
yarn install
bundle exec rails webpacker:compile
- name: Rubocop
run: bundle exec rubocop
- name: Test
env:
DATABASE_URL: postgres://ruby_au:[email protected]:${{ job.services.postgres.ports[5432] }}/ruby_au_test
run: bundle exec rspec