-
Notifications
You must be signed in to change notification settings - Fork 34
89 lines (70 loc) · 2.45 KB
/
test.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
---
name: Run tests
on:
pull_request:
branches:
- main
jobs:
build_and_test:
runs-on: ubuntu-latest
env:
CI: true
NODE_ENV: test
steps:
- name: Log node version
run: node --version
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Check TechDocs
run: yarn tech-docs:build
- name: Lint
run: yarn lint
- name: Unit test
run: yarn test:unit
- name: Fetch Scaffolder API Docs
uses: JamesIves/fetch-api-data-action@v2
with:
endpoint: https://api.roadie.so/api/scaffolder/api-docs
configuration: '{ "method": "GET", "headers": {"Authorization": "Bearer ${{ secrets.ROADIE_API_TOKEN }}"} }'
save-location: 'static/scaffolder-openapi.json'
- name: Fetch Catalog API Docs
uses: JamesIves/fetch-api-data-action@v2
with:
endpoint: https://api.roadie.so/api/catalog/api-docs
configuration: '{ "method": "GET", "headers": {"Authorization": "Bearer ${{ secrets.ROADIE_API_TOKEN }}"} }'
save-location: 'static/catalog-openapi.json'
- name: Fetch Tech Insights API Docs
uses: JamesIves/fetch-api-data-action@v2
with:
endpoint: https://api.roadie.so/api/tech-insights/v1/api-docs
configuration: '{ "method": "GET", "headers": {"Authorization": "Bearer ${{ secrets.ROADIE_API_TOKEN }}"} }'
save-location: 'static/tech-insights-openapi.json'
- name: static folder content
run: ls -la static
- name: Build static site
run: yarn build
env:
GATSBY_ALGOLIA_APP_ID: ${{ secrets.GATSBY_ALGOLIA_APP_ID }}
GATSBY_ALGOLIA_SEARCH_KEY: ${{ secrets.GATSBY_ALGOLIA_SEARCH_KEY }}
ALGOLIA_SKIP_INDEXING: true
CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }}
GATSBY_RECAPTCHAS_ENABLED: false
- name: Cypress run
uses: cypress-io/github-action@v4
with:
start: yarn serve --port 8001
- name: Upload screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Upload videos
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos