-
-
Notifications
You must be signed in to change notification settings - Fork 23
147 lines (143 loc) Β· 3.96 KB
/
test.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Test
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_call:
jobs:
ruby:
name: Test Ruby
env:
RAILS_ENV: "test"
TEST_DATABASE_URL: "mysql2://root:[email protected]:3306/dodona_test"
runs-on: ubuntu-latest
services:
mysql:
image: mariadb
env:
MYSQL_DATABASE: "dodona_test"
MYSQL_ROOT_PASSWORD: "dodona"
MARIADB_MYSQL_LOCALHOST_USER: 1
MARIADB_MYSQL_LOCALHOST_GRANTS: USAGE
MYSQL_HOST: "localhost"
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- uses: actions/checkout@v3
- name: Use ruby from .ruby-version
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Use node 16
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Install JS dependencies
run: |
yarn install
- name: Run tests
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Dodona"
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p
bin/rake css:build
yarn build:js
bundle exec rails test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: rails
javascript:
name: Test JavaScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Install dependencies
run: |
yarn install
- name: Test
run: |
yarn test --ci --runInBand --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: javascript
system:
name: Test System
env:
DISABLE_SPRING: "true"
RAILS_ENV: "test"
TEST_DATABASE_URL: "mysql2://root:[email protected]:3306/dodona_test"
runs-on: ubuntu-latest
services:
mysql:
image: mariadb
env:
MYSQL_DATABASE: "dodona_test"
MYSQL_ROOT_PASSWORD: "dodona"
MARIADB_MYSQL_LOCALHOST_USER: 1
MARIADB_MYSQL_LOCALHOST_GRANTS: USAGE
MYSQL_HOST: "localhost"
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- uses: actions/checkout@v3
- name: Use ruby from .ruby-version
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Use node 16
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Setup chromium-chromedriver
uses: nanasess/setup-chromedriver@master
with:
chromedriver-version: '115.0.5790.102'
- name: Install JS dependencies
run: |
yarn install
- name: Show installed chrome version
run: |
google-chrome --version
- name: Run tests
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
PARALLEL_WORKERS: 1
run: |
git config --global user.email "[email protected]"
git config --global user.name "Dodona"
bundle exec rails test:system
- name: Upload screenshot artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: screenshots-failure
path: tmp/capybara
- name: merge system js coverage
run: |
yarn test:system:coverage:merge
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: system