-
Notifications
You must be signed in to change notification settings - Fork 603
108 lines (98 loc) · 2.98 KB
/
run-tests.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
name: Run Tests
on:
push:
branches:
- main
pull_request:
types: [synchronize, ready_for_review, opened]
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
env:
VITE_PORTAL_API_URL: ${{ vars.VITE_PORTAL_API_URL }}
BUNDLE_GITHUB__COM: x-access-token:${{ secrets.BUNDLE_GITHUB__COM }}
jobs:
smoke-test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
# Increase number of watchers to fix tests
- run: sudo sysctl -w fs.inotify.max_user_watches=524288
- uses: actions/checkout@v4
with:
submodules: 'recursive'
# Configure Ruby to build Jekyll site
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
- name: Ruby gem cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle Setup
run: bundle config path ${{ github.workspace }}/vendor/bundle
- name: Bundle Install
run: bundle install --jobs 4 --retry 3
- name: Install foreman
run: gem install foreman
# Configure Node to build assets
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
# Build the Docs
- name: Build Docs
run: |
npm ci
exe/build
- name: Run Smoke Tests
env:
JEKYLL_ENV: production
JEKYLL_CONFIG_FILES: jekyll.yml
run: |
npm install -g wait-on
netlify dev & wait-on http://localhost:8888
npm test
- name: Check for broken markdown anchors
run: |
./tools/missing-markdown-anchor/run.sh
rspec:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
# Configure Node to build assets
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- run: npm ci
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Run specs
run: bundle exec rspec