-
Notifications
You must be signed in to change notification settings - Fork 75
101 lines (100 loc) · 3.22 KB
/
validations.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
name: CI Test Suite
on:
push:
branches: [develop, main]
pull_request:
types: [labeled, opened, synchronize, reopened]
workflow_dispatch:
jobs:
tests:
name: Running tests
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PostgreSQL
uses: Harmon758/[email protected]
with:
postgresql version: 14.9-alpine3.18
postgresql db: miru_web_test_${{ github.event.number }}
postgresql user: root
postgresql password: "password"
- name: Setup ElasticSearch
uses: ankane/setup-elasticsearch@v1
- name: Setup chrome
uses: nanasess/setup-chromedriver@v2
with:
# Optional: do not specify to match Chrome's version
chromedriver-version: "88.0.4324.96"
- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- name: Check if Elasticsearch is reachable
run: |
curl --verbose --show-error http://localhost:9200
- name: Setup Ruby
uses: ruby/setup-ruby@v1
- name: Ruby gem cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Audit gems
run: |
bundle exec bundle-audit --update
bundle exec ruby-audit check
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 18.14.2
- name: Find yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: JS package cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: |
yarn install --pure-lockfile
- name: Setup kernel for guard, increase watchers
run: |
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Setup Env's
run: |
cp .env.example .env
- name: ffi pristine
run: bundle pristine ffi
- name: Setup test database
env:
RAILS_ENV: test
DB_USER: root
DB_PASS: "password"
TEST_ENV_NUMBER: ${{ github.event.number }}
run: |
bundle exec rails db:prepare
- name: Run Rubocop
run: |
bundle exec rubocop
- name: Run tests
env:
RAILS_ENV: test
DB_USER: root
DB_PASS: "password"
TEST_ENV_NUMBER: ${{ github.event.number }}
run:
bundle exec rspec --exclude-pattern "spec/system/**/*_spec.rb"
- name: Run Eslint
run: |
npx eslint "./app/javascript/**/*.{ts,tsx,js,jsx,json}"