1
- # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
-
4
1
name : build
5
2
6
3
on :
7
4
push :
8
5
branches : [ master ]
6
+ pull_request :
7
+ branches : [ '**' ]
9
8
10
9
jobs :
11
- build_and_test :
12
-
10
+ build :
11
+ name : Build NgxForm
13
12
runs-on : ubuntu-latest
14
-
15
13
strategy :
16
14
matrix :
17
15
node-version : [ 18.19.1 ]
18
16
19
17
steps :
20
- - uses : actions/checkout@v2
18
+ - name : Checkout Repository
19
+ uses : actions/checkout@v2
20
+
21
21
- name : Use Node.js ${{ matrix.node-version }}
22
22
uses : actions/setup-node@v1
23
23
with :
24
24
node-version : ${{ matrix.node-version }}
25
+
25
26
- name : Installation
26
27
run : npm ci
28
+
27
29
- name : Build NgxForm
28
30
run : npm run build:ngx-form
29
31
env :
30
32
CI : true
31
- - name : Linter
33
+
34
+ - name : Archive build artifact
35
+ uses : actions/upload-artifact@master
36
+ with :
37
+ name : ngx-form-build
38
+ path : ./dist/ngx-form
39
+
40
+ lint :
41
+ name : Lint
42
+ runs-on : ubuntu-latest
43
+ strategy :
44
+ matrix :
45
+ node-version : [ 18.19.1 ]
46
+
47
+ steps :
48
+ - name : Checkout Repository
49
+ uses : actions/checkout@v2
50
+
51
+ - name : Use Node.js ${{ matrix.node-version }}
52
+ uses : actions/setup-node@v1
53
+ with :
54
+ node-version : ${{ matrix.node-version }}
55
+
56
+ - name : Installation
57
+ run : npm ci
58
+
59
+ - name : Run Linter
32
60
run : npm run lint
33
- - name : Test
61
+
62
+ test :
63
+ name : Test
64
+ runs-on : ubuntu-latest
65
+ strategy :
66
+ matrix :
67
+ node-version : [ 18.19.1 ]
68
+
69
+ steps :
70
+ - name : Checkout Repository
71
+ uses : actions/checkout@v2
72
+
73
+ - name : Use Node.js ${{ matrix.node-version }}
74
+ uses : actions/setup-node@v1
75
+ with :
76
+ node-version : ${{ matrix.node-version }}
77
+
78
+ - name : Installation
79
+ run : npm ci
80
+
81
+ - name : Run Tests
34
82
run : npm run test:ci
83
+
84
+ - name : Archive Coverage Artifact
85
+ uses : actions/upload-artifact@master
86
+ with :
87
+ name : ngx-form-coverage
88
+ path : ./coverage
89
+
90
+ coverall :
91
+ name : Coverall
92
+ needs : test
93
+ runs-on : ubuntu-latest
94
+ if : github.ref == 'refs/heads/master'
95
+ strategy :
96
+ matrix :
97
+ node-version : [ 18.19.1 ]
98
+
99
+ steps :
100
+ - name : Checkout Repository
101
+ uses : actions/checkout@v2
102
+
103
+ - name : Download Coverage Artifact
104
+ uses : actions/download-artifact@master
105
+ with :
106
+ name : ngx-form-coverage
107
+ path : ./coverage
108
+
35
109
- name : Send coverage to Coverall
36
110
uses : coverallsapp/github-action@v1.0.1
37
111
with :
38
112
github-token : ${{ secrets.GITHUB_TOKEN }}
39
113
path-to-lcov : ./coverage/ngx-form/lcov.info
40
114
115
+ deploy_paddls :
116
+ name : Deploy NgxForm @paddls
117
+ needs : [ build, lint, test ]
118
+ if : github.ref == 'refs/heads/master'
119
+ runs-on : ubuntu-latest
120
+ strategy :
121
+ matrix :
122
+ node-version : [ 18.19.1 ]
123
+
124
+ steps :
125
+ - name : Checkout Repository
126
+ uses : actions/checkout@v2
127
+
128
+ - name : Download Build Artifact
129
+ uses : actions/download-artifact@master
130
+ with :
131
+ name : ngx-form-build
132
+ path : ./dist/ngx-form
133
+
41
134
- name : " Publish @paddls/ngx-form"
42
135
uses : pascalgn/npm-publish-action@1.3.9
43
136
with :
@@ -49,12 +142,33 @@ jobs:
49
142
env :
50
143
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51
144
NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN_PADDLS }}
145
+
146
+ deploy_witty :
147
+ name : Deploy NgxForm @witty-services
148
+ needs : [ build, lint, test ]
149
+ if : github.ref == 'refs/heads/master'
150
+ runs-on : ubuntu-latest
151
+ strategy :
152
+ matrix :
153
+ node-version : [ 18.19.1 ]
154
+
155
+ steps :
156
+ - name : Checkout Repository
157
+ uses : actions/checkout@v2
158
+
159
+ - name : Download Build Artifact
160
+ uses : actions/download-artifact@master
161
+ with :
162
+ name : ngx-form-build
163
+ path : ./dist/ngx-form
164
+
52
165
- name : " PrePublish @witty-services/ngx-form"
53
166
uses : jossef/action-set-json-field@v1
54
167
with :
55
168
file : " ./dist/ngx-form/package.json"
56
169
field : name
57
170
value : " @witty-services/ngx-form"
171
+
58
172
- name : " Publish @witty-services/ngx-form"
59
173
uses : pascalgn/npm-publish-action@1.3.9
60
174
with :
0 commit comments