-
Notifications
You must be signed in to change notification settings - Fork 6
151 lines (147 loc) · 4.63 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
139
140
141
142
143
144
145
146
147
148
149
150
151
name: CI
on:
push: {}
pull_request:
types: [opened, synchronize]
jobs:
build:
runs-on: ubuntu-18.04
services:
db:
env:
POSTGRES_USER: postgres
POSTGRES_DB: nexmo_developer_test
POSTGRES_HOST_AUTH_METHOD: trust
image: postgres:11
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Find yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: JS package cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: |
yarn install --pure-lockfile
- name: Set up Ruby 3.0.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
- name: Ruby gem cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install postgres headers
run: sudo apt-get -yqq install libpq-dev
- name: Bundle Setup
run: |
gem update --system 3.1.4 -N
gem install --no-document bundler
bundle config path ${{ github.workspace }}/vendor/bundle
working-directory: ./lib/nexmo_developer
- name: Bundle Install
env:
POSTGRES_USERNAME: postgres
run: |
bundle install --jobs 4 --retry 3 --deployment
working-directory: ./lib/nexmo_developer
- name: Precompile assets
env:
DOCS_BASE_PATH: ./spec/fixtures
RAILS_SERVE_STATIC_FILES: 1
DISABLE_SSL: 1
RAILS_LOG_TO_STDOUT: 1
RAILS_ENV: production
run: bundle exec rails assets:precompile
working-directory: ./lib/nexmo_developer
- name: Fetch NDP
uses: actions/checkout@master
with:
ref: main
repository: nexmo/nexmo-developer
token: ${{ secrets.GITHUB_TOKEN }}
path: ndp
submodules: true
- name: Fetch VDP
uses: actions/checkout@master
with:
ref: master
repository: VonageGarage/VDP
token: ${{ secrets.GITHUB_TOKEN }}
path: vdp
submodules: true
- name: Precompile assets ENV=test
env:
RAILS_SERVE_STATIC_FILES: 1
DISABLE_SSL: 1
RAILS_LOG_TO_STDOUT: 1
RAILS_ENV: test
run: bundle exec rails assets:precompile
working-directory: ./lib/nexmo_developer
- name: Run Platform Tests
env:
POSTGRES_USERNAME: postgres
DOCS_BASE_PATH: ./spec/fixtures
BLOG_PATH: ./spec/fixtures/_blog
OAS_PATH: ./spec/fixtures/api_specs/definitions
FORCE_COLOR: true
run: |
bundle exec rails db:create
bundle exec rails db:migrate
bundle exec rake spec
bundle exec rubocop
working-directory: ./lib/nexmo_developer
- name: Run NDP Tests
env:
POSTGRES_USERNAME: postgres
DOCS_BASE_PATH: ${{ github.workspace }}/ndp
OAS_PATH: ${{ github.workspace }}/ndp/_open_api/api_specs/definitions
FORCE_COLOR: true
run: |
bundle exec rake ci:verify_pages
bundle exec rake ci:verify_navigation
bundle exec rake ci:verify_oas_reference
RAILS_ENV=test bundle exec rake ci:verify_error_urls_resolve
bundle exec rake ci:check_word_blocklist
bundle exec rake ci:check_ruby_version
working-directory: ./lib/nexmo_developer
- name: Run VDP Tests
env:
POSTGRES_USERNAME: postgres
DOCS_BASE_PATH: ${{ github.workspace }}/vdp
OAS_PATH: ${{ github.workspace }}/vdp/_open_api/definitions
FORCE_COLOR: true
run: |
bundle exec rake ci:verify_pages
bundle exec rake ci:verify_navigation
bundle exec rake ci:verify_oas_reference
bundle exec rake ci:check_word_blocklist
bundle exec rake ci:check_ruby_version
working-directory: ./lib/nexmo_developer
- name: Run Javascript Tests
run: |
yarn test
- name: Spell checker
env:
FORCE_COLOR: true
run: |
./node_modules/.bin/mdspell -r -n -a --en-us '_documentation/en/**/*.md' '_partials/*.md' '_partials/**/*.md' '_modals/**/*.md' '_tutorials/**/*.md'