forked from researchdata-sheffield/dataviz-hub2
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (91 loc) · 2.83 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
name: CI
on:
push:
branches-ignore: [ master ]
pull_request:
branches: [ '**' ]
types: [
opened,
synchronize,
reopened ]
workflow_dispatch:
inputs:
Name:
required: true
default: 'Re-run the workflow'
Description:
default: ''
jobs:
CI-Build:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
- uses: actions/checkout@v2
- name: NPM Cache
id: npm-cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-cache-
# Retrieve gatsby cache
# Creates new cache when OS/run_id changes
- name: Gatsby Cache
id: gatsby-ci-cache
uses: actions/cache@v2
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-ci-${{ github.run_id }}
restore-keys: ${{ runner.os }}-gatsby-ci-
- name: Install playwright dependencies
uses: microsoft/playwright-github-action@v1
- name: Install dependencies
run: npm ci
# Enable incremental build
- name: Incremental build
run: NODE_OPTIONS=--max_old_space_size=4096 npm run build:noGA
env:
EVENT_API_KEY_1: ${{ secrets.EVENT_API_KEY_1 }}
EVENT_API_KEY_2: ${{ secrets.EVENT_API_KEY_2 }}
EVENT_ORG_ID_1: ${{ secrets.EVENT_ORG_ID_1 }}
EVENT_ORG_ID_2: ${{ secrets.EVENT_ORG_ID_2 }}
GATSBY_GH_APP_GITALK_ID: ${{ secrets.GATSBY_GH_APP_GITALK_ID }}
GATSBY_GH_APP_GITALK_SECRET: ${{ secrets.GATSBY_GH_APP_GITALK_SECRET }}
GATSBY_ENV: ${{ secrets.GATSBY_ENV }}
- name: Serve and E2E test
run: npm run serve & npm run test:e2e
Test:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
- uses: actions/checkout@v2
- name: NPM Cache
id: npm-cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-cache-
- name: Install playwright dependencies
uses: microsoft/playwright-github-action@v1
- name: Install dependencies
run: npm ci
- name: Jest cache
id: gatsby-jest-cache
uses: actions/cache@v2
with:
path: .jest-cache
key: ${{ runner.os }}-jestCache-${{ github.run_id }}
restore-keys: ${{ runner.os }}-jestCache-
- name: tests
run: npm run test