forked from CircuitVerse/CircuitVerse
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (85 loc) · 2.55 KB
/
rubyonrails.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
name: "Ruby on Rails CI"
on:
[push, pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
redis:
image: redis:alpine
ports: ["6379:6379"]
options: --entrypoint redis-server
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 100
submodules: recursive
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1 # v1.115.3
with:
bundler-cache: true
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- run: yarn install --frozen-lockfile --immutable
- name: Copy the sample ENV Config
run: cp .env.example .env
- name: Set up database schema
run: bin/rails db:schema:load
- name: Run data migration tasks
run: bin/rails data:migrate
- name: Build assets
run: yarn run build
- name: Configure keys
run: |
openssl genrsa -out config/private.pem 2048
openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem
- name: Run tests
run: bundle exec rspec
- uses: aki77/delete-pr-comments-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
bodyContains: "[undercover]"
noReply: "true"
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.github_token }}
run: |
git fetch --no-tags
reviewdog -reporter=github-pr-review -runners=undercover --fail-on-error
- name: Static type checking
run: |
bundle exec rbs collection install
bundle exec steep check
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1 # v1.115.3
with:
bundler-cache: true
- name: Security audit dependencies
run: bundle exec bundler-audit --update
- name: Lint Ruby files
run: bundle exec rubocop --parallel