-
Notifications
You must be signed in to change notification settings - Fork 642
86 lines (71 loc) · 2.45 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
name: CI
# Controls when the workflow will run
on: ['push', 'pull_request', 'workflow_dispatch']
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# checks-out your repository under $GITHUB_WORKSPACE , so that workflow can access it.
- name: checkout
uses: actions/checkout@v2
- name: install Pandoc
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.9.2.1'
- name: setup Redis
uses: supercharge/[email protected]
# Setting up MariaDB based upon 'config/database.example.yml'
- name: setup MariaDB server
uses: getong/[email protected]
with:
host port: 3306
mariadb version: '10.5'
mysql database: 'dashboard_testing'
mysql user: 'wiki'
mysql password: 'wikiedu'
# Starting ruby
- name: setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
bundler-cache: true
- name: setup Node
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
- name: setup Dashboard database
env:
RAILS_ENV: test
DATABASE_PORT: 3306
run: |
mkdir tmp -m 777
cp config/application.example.yml config/application.yml
cp config/database.example.yml config/database.yml
bin/rails db:migrate RAILS_ENV=test
- name: Cache Webpack cache
id: cache-webpack
uses: actions/cache@v3
with:
path: node_modules/.cache/
key: ${{ runner.os }}-webpack
#Testing the pushed code onwards
- name: JavaScript test suite
run: |
yarn install --immutable
yarn coverage
yarn run test
- name: JavaScript linting
run: yarn lint-non-build
- name: Ruby rspec test suite
uses: paambaati/[email protected]
env:
COVERAGE: true
CC_TEST_REPORTER_ID: f0d5d763ddc6b3f980ba0fb0c38e7c27c0dffc4a5787cd7d5b8c2b0c3b2e27e2
with:
coverageCommand: bundle exec rspec spec/ --color --profile --format documentation
coverageLocations: |
${{github.workspace}}/public/js_coverage/lcov.info:lcov
- name: Ruby linting
run: bundle exec rubocop