-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (59 loc) · 1.92 KB
/
test-and-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
66
67
68
69
70
71
72
73
74
75
76
name: test-and-build
run-name: Tests and prepares build for deploying
concurrency:
group: '${{ github.workflow }}'
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches:
master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arduino/setup-task@v2
- name: Prepare env
run: task -d .ci env
- name: Initialize everything
run: task -d .ci init
- name: Lint
run: task -d .ci root:lint
- name: 'Cache node_modules: check'
uses: actions/cache/restore@v4
id: cache-node-modules
with:
path: |
frontend/node_modules
backend/node_modules
key: node-modules-${{ hashFiles('frontend/yarn.lock', 'backend/yarn.lock') }}
- if: steps.cache-node-modules.outputs.cache-hit != 'true'
name: 'Cache node_modules doesn''t exist: install'
run: task -d .ci yarn
- if: steps.cache-node-modules.outputs.cache-hit != 'true'
name: 'Cache node_modules doesn''t exist: save node_modules to cache'
uses: actions/cache/save@v4
with:
path: |
frontend/node_modules
backend/node_modules
key: node-modules-${{ hashFiles('frontend/yarn.lock', 'backend/yarn.lock') }}
- name: Set permissions for node_modules
run: sudo chmod -R 777 frontend/node_modules
- name: Build 'frontend' and 'backend'
run: task -d .ci build
- name: Start project
run: task -d .ci up
- name: Starts testing
run: task -d .ci test
- name: 'Uploads ''frontend/dist'' artifact'
uses: actions/upload-artifact@v4
with:
path: frontend/dist
name: frontend-dist
- name: 'Uploads ''backend/dist'' artifact'
uses: actions/upload-artifact@v4
with:
path: backend/dist
name: backend-dist