-
Notifications
You must be signed in to change notification settings - Fork 654
138 lines (113 loc) · 3.88 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
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
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'
# Install the latest version of ImageMagick
- name: Setup ImageMagick
uses: mfinelli/setup-imagemagick@v6
with:
cache: true
# Cache ImageMagick binaries
- name: Cache Latest ImageMagick
uses: actions/cache@v3
with:
path: /usr/bin/magick
key: ${{ runner.os }}-imagemagick-latest
restore-keys: |
${{ runner.os }}-imagemagick-latest
# Create symlink for identify
- name: Create Symlink for identify
run: |
if ! [ -x "$(command -v identify)" ]; then
sudo ln -s $(which magick) /usr/bin/identify
fi
# Debug steps
- name: Debug magick command
run: |
echo "Magick location: $(which magick)"
echo "Magick version: $(magick -version)"
- name: Check if identify exists
run: |
echo "Identify location: $(which identify)"
- name: Check ImageMagick
run: which magick
- name: Check ImageMagick Version
run: magick -version
- name: Testing which imagemagick
run: magick convert
- name: Verify identify Command
run: identify -version
- 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: Archive capybara failure screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: dist-without-markdown
path: tmp/capybara/*.png
if-no-files-found: ignore
- name: Ruby linting
run: bundle exec rubocop