-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.74 KB
/
gap-web-ui-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
name: gap-web-ui CI
on:
pull_request:
branches:
- develop
- feat/**
- feature/**
paths:
- "packages/gap-web-ui/**"
- ".github/workflows/gap-web-ui-ci.yml"
- "package.json"
- "yarn.lock"
jobs:
test:
name: Test app
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Generate gap-web-ui hash
id: gap-web-ui-hash
run: |
NAME=${{ hashFiles('**/packages/gap-web-ui/**/*.js', '**/packages/gap-web-ui/**/*.jsx', '**/packages/gap-web-ui/**/*.ts', '**/packages/gap-web-ui/**/*.tsx') }}
echo "name=$NAME" >> $GITHUB_OUTPUT
- name: Read .nvmrc
id: nvm
run: echo "name=NVMRC::$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Restore gap-web-ui cache
id: gap-web-ui-cache
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/packages/gap-web-ui/dist
key: gap-web-ui-${{ steps.gap-web-ui-hash.outputs.name }}
- name: Build gap-web-ui
if: steps.gap-web-ui-cache.outputs.cache-hit != 'true'
run: yarn workspace gap-web-ui build
- name: Save gap-web-ui cache
if: steps.gap-web-ui-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: ${{ github.workspace }}/packages/gap-web-ui/dist
key: gap-web-ui-${{ steps.gap-web-ui-hash.outputs.name }}
- name: Units Tests
run: yarn jest --selectProjects gap-web-ui --runInBand --ci