-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (107 loc) · 3.33 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Pull-Request
on: [push]
jobs:
rails-basics:
runs-on: ubuntu-20.04
env:
RAILS_ENV: test
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Controllers Annotation
run: >- # To fix: bin/chusaku
bundle exec chusaku &&
bin/git_tracked_are_unmodified
- name: Lint with Rubocop
run: bundle exec rubocop -c .rubocop.yml
rails-with-db:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: finances
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
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/finances
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Create PG Database
run: bundle exec rake db:create
- name: Migrate DB
run: >- # To fix: bin/rails db:migrate
bundle exec rake db:migrate &&
bin/git_tracked_are_unmodified
- name: Model and Routes Annotation
run: >- # To fix: bin/annotate
bundle exec annotate &&
bin/git_tracked_are_unmodified
- name: Ruby Tests & Coverage
run: bundle exec rspec --format documentation
graphql-code-gen:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: finances
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
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/finances
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Create PG Database
run: bundle exec rake db:create db:schema:load
- name: Starting Rails server
run: bin/rails server --port 30001 --binding 127.0.0.1 &
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 22
- name: Install JavaScript Dependencies
run: yarn install
- name: Generate GraphQL schema file & ensure it is up to date
run: >- # To fix, while Rails server is running: yarn gql:gen
yarn gql:gen &&
bin/git_tracked_are_unmodified
client:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 22
- name: Install JavaScript Dependencies
run: yarn install
- name: Generate GraphQL Client Code from local schema file
run: yarn gql:gen
env:
SCHEMA_PATH: ./schema.generated.graphql
- name: Lint JS/TS
run: yarn lint
- name: Tests
run: yarn test