generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 2.62 KB
/
frontend-build.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
# This file was autogenerated by the KMAP workflow build script
name: Frontend build
on: [ push ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
node-version: [ 12.x, 14.x, 15.x ]
env:
working-directory: ./frontend
cache-frontend: true
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g yarn
# kmap.import-action.cache #
# Cypress
- name: Get cypress version from yarn.lock
if: ${{ env.cache-frontend == 'true' }}
id: cypress-version-frontend
run: echo "::set-output name=version::$(node getCypressVersion)"
working-directory: ./build
- name: Setup cypress cache (windows)
id: cypress-cache-windows
if: ${{ env.cache-frontend == 'true' && matrix.os == 'windows-latest' }}
uses: actions/cache@v2
with:
path: ~/AppData/Local/Cypress/Cache/${{ steps.cypress-version-frontend.outputs.version }}
key: cypress-cache-windows-${{ matrix.node-version }}-${{ steps.cypress-version-frontend.outputs.version }}
- name: Setup cypress cache (ubuntu)
if: ${{ env.cache-frontend == 'true' && matrix.os == 'ubuntu-latest' }}
id: cypress-cache-ubuntu
uses: actions/cache@v2
with:
path: ~/.cache/Cypress/${{ steps.cypress-version-frontend.outputs.version }}
key: cypress-cache-ubuntu-${{ matrix.node-version }}-${{ steps.cypress-version-frontend.outputs.version }}
# FE node_modules
- name: Cache node_modules (frontend)
if: ${{ env.cache-frontend == 'true' && (steps.cypress-cache-ubuntu.outputs.cache-hit == 'true' || steps.cypress-cache-windows.outputs.cache-hit == 'true') }}
uses: actions/cache@v2
with:
path: frontend/node_modules
key: ${{ matrix.os }}-${{ matrix.node-version }}-yarn-frontend-${{ hashFiles('frontend/yarn.lock') }}
# BE node_modules
- name: Cache node_modules (backend)
if: ${{ env.cache-backend == 'true' }}
uses: actions/cache@v2
with:
path: backend/node_modules
key: ${{ matrix.os }}-${{ matrix.node-version }}-yarn-backend-${{ hashFiles('frontend/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline --network-timeout 1000000
working-directory: ${{ env.working-directory }}
- run: yarn run build
working-directory: ${{ env.working-directory }}