File tree 3 files changed +36
-61
lines changed
3 files changed +36
-61
lines changed Original file line number Diff line number Diff line change 1
1
version : v1.0
2
2
3
- name : NPM deployment
3
+ name : Publish to NPM
4
4
agent :
5
5
machine :
6
6
type : e1-standard-2
@@ -11,9 +11,12 @@ blocks:
11
11
task :
12
12
secrets :
13
13
- name : workos-npm
14
+ prologue :
15
+ commands :
16
+ - checkout
17
+ - nvm use
18
+ - yarn install
14
19
jobs :
15
- - name : Publish to NPM
20
+ - name : yarn publish
16
21
commands :
17
- - checkout
18
- - yarn install
19
22
- yarn publish --access=public
Original file line number Diff line number Diff line change @@ -2,89 +2,47 @@ version: v1.0
2
2
name : workos-node pipeline
3
3
4
4
execution_time_limit :
5
- minutes : 15
5
+ minutes : 10
6
6
7
7
agent :
8
8
machine :
9
9
type : e1-standard-2
10
10
os_image : ubuntu1804
11
11
12
12
global_job_config :
13
+ env_vars :
14
+ - name : NODE_ENV
15
+ value : test
13
16
prologue :
14
17
commands :
15
18
- checkout
16
19
- nvm use
20
+ - bash ~/workos-node/bin/restore-or-install
17
21
18
22
blocks :
19
23
- name : Install dependencies
24
+ dependencies : []
20
25
task :
21
- secrets :
22
- - name : workos-npm
23
- env_vars :
24
- - name : NODE_ENV
25
- value : test
26
- - name : CI
27
- value : ' true'
28
26
jobs :
29
27
- name : yarn install and cache
30
28
commands :
31
- - cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
32
- - yarn install
33
- - cache store client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock) node_modules
29
+ - ls -d node_modules
34
30
35
- - name : Lint
31
+ - name : Test
32
+ dependencies : ['Install dependencies']
36
33
task :
37
- secrets :
38
- - name : workos-npm
39
- env_vars :
40
- - name : NODE_ENV
41
- value : test
42
- - name : CI
43
- value : ' true'
44
34
jobs :
45
- - name : Run lint
35
+ - name : yarn prettier
46
36
commands :
47
- - cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
48
- - yarn lint
49
-
50
- - name : Formatting
51
- task :
52
- secrets :
53
- - name : workos-npm
54
- env_vars :
55
- - name : NODE_ENV
56
- value : test
57
- - name : CI
58
- value : ' true'
59
- jobs :
60
- - name : Run prettier
61
- commands :
62
- - cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
63
37
- yarn prettier
64
-
65
- - name : Tests
66
- task :
67
- secrets :
68
- - name : workos-npm
69
- env_vars :
70
- - name : NODE_ENV
71
- value : test
72
- - name : CI
73
- value : ' true'
74
- jobs :
75
- - name : Run tests
38
+ - name : yarn lint
39
+ commands :
40
+ - yarn lint
41
+ - name : yarn test
76
42
commands :
77
- - cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
78
43
- yarn test
79
-
80
- - name : Build
81
- task :
82
- secrets :
83
- - name : workos-npm
84
- jobs :
85
- - name : Run build
44
+ - name : yarn build
86
45
commands :
87
- - cache restore client-node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum yarn.lock),client-node-modules-$SEMAPHORE_GIT_BRANCH,client-node-modules-master
88
46
- yarn build
89
47
90
48
promotions :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ KEY=" node-modules-$( checksum yarn.lock) "
4
+ cache restore $KEY
5
+
6
+ if [[ ! ` ls -d ./node_modules 2> /dev/null` ]]; then
7
+ yarn install
8
+ cache store $KEY ./node_modules
9
+ fi
10
+
11
+ if [[ ! ` ls -d ./node_modules/.bin 2> /dev/null` ]]; then
12
+ yarn install --check-files
13
+ cache store $KEY ./node_modules
14
+ fi
You can’t perform that action at this time.
0 commit comments