-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
56 lines (48 loc) · 1.11 KB
/
.gitlab-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
---
image: "ruby:3.1"
variables:
RAILS_ENV: test
CACHE_FALLBACK_KEY: "$CI_COMMIT_REF_SLUG"
before_script:
# Setup Node.js
- curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
- bash nodesource_setup.sh
- apt-get install -y nodejs
# Install Yarn
- npm config set registry https://registry.npmmirror.com/ --global
- npm install --global yarn
# Verify installations
- node -v
- yarn -v
- ruby -v
- which ruby
# Setup Bundler
- gem install bundler --no-document
- bundle config set path 'vendor' # Install dependencies into ./vendor/ruby
- bundle install --jobs $(nproc)
# Install JavaScript dependencies
- yarn install --cache-folder .yarn-cache
stages:
- test
test:
stage: test
cache:
- key:
files:
- Gemfile.lock
paths:
- vendor/ruby
- key:
files:
- yarn.lock
paths:
- .yarn-cache/
script:
- bundle exec standardrb
- bin/rails db:drop RAILS_ENV=test
- bin/rails db:setup RAILS_ENV=test
- bin/rails test
- bin/rails test:system
only:
- main
- merge_requests