forked from kantord/LibreLingo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsemaphore.yml
102 lines (102 loc) · 3.04 KB
/
semaphore.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
version: v1.0
name: Node JS
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Set up dependencies
task:
jobs:
- name: yarn install
commands:
- sem-version node 14
- checkout
- cache restore
- cache restore node-$(checksum yarn.lock)
- cache restore cypress-$(checksum yarn.lock)
- cache restore packages-web-$(checksum yarn.lock)
- yarn install --frozen-lockfile
- yarn cypress install
- cache store
- cache store node-$(checksum yarn.lock) node_modules
- cache store cypress-$(checksum yarn.lock) /home/semaphore/.cache/Cypress
- cache store packages-web-$(checksum yarn.lock) apps/web/node_modules
dependencies: []
- name: Jest
task:
jobs:
- name: yarn jest
commands:
- sem-version node 14
- checkout
- cache restore node-$(checksum yarn.lock)
- yarn jest
dependencies:
- JavaScript Linting
- name: Cypress
task:
jobs:
- name: cypress and percy
commands:
- sem-version node 14
- checkout
- cache restore node-$(checksum yarn.lock)
- cache restore cypress-$(checksum yarn.lock)
- cache restore packages-web-$(checksum yarn.lock)
- cache restore sapper-build-$SEMAPHORE_GIT_SHA
- yarn install
- find ./apps/web/src
- 'yarn test:ci'
secrets:
- name: Percy token
- name: KnapsackPro token
dependencies:
- Sapper static build
- name: JavaScript Linting
dependencies:
- Set up dependencies
task:
jobs:
- name: yarn lint
commands:
- sem-version node 14
- checkout
- cache restore node-$(checksum yarn.lock)
- yarn lint
- name: TypeScript check
dependencies:
- Jest
task:
jobs:
- name: yarn types
commands:
- sem-version node 14
- checkout
- cache restore node-$(checksum yarn.lock)
- cache restore packages-web-$(checksum yarn.lock)
- yarn types
- name: Sapper static build
dependencies:
- Set up dependencies
task:
jobs:
- name: yarn web export
commands:
- sem-version node 14
- checkout
- cache restore node-$(checksum yarn.lock)
- cache restore cypress-$(checksum yarn.lock)
- cache restore packages-web-$(checksum yarn.lock)
- yarn web export
- find ./apps/web/__sapper__/
- cache store sapper-build-$SEMAPHORE_GIT_SHA ./apps/web/__sapper__/
promotions:
- name: Deploy to production
pipeline_file: pipeline_2.yml
auto_promote:
when: branch = 'main' AND result = 'passed'
- name: Release packages
pipeline_file: pipeline_3.yml
auto_promote:
when: branch = 'main' AND result = 'passed'