Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 080b0ba

Browse files
committed
ci: Introduce integrate CI workflow
1 parent 1f0804c commit 080b0ba

File tree

1 file changed

+239
-0
lines changed

1 file changed

+239
-0
lines changed

.github/workflows/integrate.yml

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
# master only
2+
3+
name: Integrate
4+
5+
on:
6+
push:
7+
branches: [master]
8+
9+
env:
10+
FORCE_COLOR: 1
11+
12+
jobs:
13+
linuxNode16:
14+
name: '[Linux] Node.js v16: Unit tests'
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [2.7, 3.6]
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
23+
- name: Retrieve dependencies from cache
24+
id: cacheNpm
25+
uses: actions/cache@v2
26+
with:
27+
path: |
28+
~/.npm
29+
node_modules
30+
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
31+
restore-keys: npm-v16-${{ runner.os }}-${{ github.ref }}-
32+
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v1
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Install Node.js and npm
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: 16.x
42+
43+
- name: Check python version
44+
run: |
45+
python --version
46+
47+
- name: Install setuptools
48+
run: python -m pip install --force setuptools wheel
49+
50+
- name: Install pipenv / poetry
51+
run: python -m pip install pipenv poetry
52+
53+
- name: Install serverless
54+
run: npm install -g serverless@2
55+
56+
- name: Install dependencies
57+
if: steps.cacheNpm.outputs.cache-hit != 'true'
58+
run: |
59+
npm update --no-save
60+
npm update --save-dev --no-save
61+
- name: Unit tests
62+
run: script -e -c "npm test"
63+
64+
windowsNode16:
65+
name: '[Windows] Node.js v16: Unit tests'
66+
runs-on: windows-latest
67+
strategy:
68+
matrix:
69+
python-version: [2.7, 3.6]
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@v2
73+
74+
- name: Retrieve dependencies from cache
75+
id: cacheNpm
76+
uses: actions/cache@v2
77+
with:
78+
path: |
79+
~/.npm
80+
node_modules
81+
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
82+
restore-keys: npm-v16-${{ runner.os }}-${{ github.ref }}-
83+
84+
- name: Set up Python ${{ matrix.python-version }}
85+
uses: actions/setup-python@v1
86+
with:
87+
python-version: ${{ matrix.python-version }}
88+
89+
- name: Install Node.js and npm
90+
uses: actions/setup-node@v1
91+
with:
92+
node-version: 16.x
93+
94+
- name: Check python version
95+
run: |
96+
python --version
97+
98+
- name: Install setuptools
99+
run: python -m pip install --force setuptools wheel
100+
101+
- name: Install pipenv / poetry
102+
run: python -m pip install pipenv poetry
103+
104+
- name: Install serverless
105+
run: npm install -g serverless@2
106+
107+
- name: Install dependencies
108+
if: steps.cacheNpm.outputs.cache-hit != 'true'
109+
run: |
110+
npm update --no-save
111+
npm update --save-dev --no-save
112+
- name: Unit tests
113+
run: npm test
114+
115+
linuxNode14:
116+
name: '[Linux] Node.js 14: Unit tests'
117+
runs-on: ubuntu-latest
118+
strategy:
119+
matrix:
120+
python-version: [2.7, 3.6]
121+
steps:
122+
- name: Checkout repository
123+
uses: actions/checkout@v2
124+
125+
- name: Retrieve dependencies from cache
126+
id: cacheNpm
127+
uses: actions/cache@v2
128+
with:
129+
path: |
130+
~/.npm
131+
node_modules
132+
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
133+
restore-keys: npm-v14-${{ runner.os }}-${{ github.ref }}-
134+
135+
- name: Set up Python ${{ matrix.python-version }}
136+
uses: actions/setup-python@v1
137+
with:
138+
python-version: ${{ matrix.python-version }}
139+
140+
- name: Install Node.js and npm
141+
uses: actions/setup-node@v1
142+
with:
143+
node-version: 14.x
144+
145+
- name: Check python version
146+
run: |
147+
python --version
148+
149+
- name: Install setuptools
150+
run: python -m pip install --force setuptools wheel
151+
152+
- name: Install pipenv / poetry
153+
run: python -m pip install pipenv poetry
154+
155+
- name: Install serverless
156+
run: npm install -g serverless@2
157+
158+
- name: Install dependencies
159+
if: steps.cacheNpm.outputs.cache-hit != 'true'
160+
run: |
161+
npm update --no-save
162+
npm update --save-dev --no-save
163+
- name: Unit tests
164+
run: script -e -c "npm test"
165+
166+
linuxNode12:
167+
name: '[Linux] Node.js v12: Unit tests'
168+
runs-on: ubuntu-latest
169+
strategy:
170+
matrix:
171+
python-version: [2.7, 3.6]
172+
steps:
173+
- name: Checkout repository
174+
uses: actions/checkout@v2
175+
176+
- name: Retrieve dependencies from cache
177+
id: cacheNpm
178+
uses: actions/cache@v2
179+
with:
180+
path: |
181+
~/.npm
182+
node_modules
183+
key: npm-v12-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
184+
restore-keys: npm-v12-${{ runner.os }}-${{ github.ref }}-
185+
186+
- name: Set up Python ${{ matrix.python-version }}
187+
uses: actions/setup-python@v1
188+
with:
189+
python-version: ${{ matrix.python-version }}
190+
191+
- name: Install Node.js and npm
192+
uses: actions/setup-node@v1
193+
with:
194+
node-version: 12.x
195+
196+
- name: Check python version
197+
run: |
198+
python --version
199+
200+
- name: Install setuptools
201+
run: python -m pip install --force setuptools wheel
202+
203+
- name: Install pipenv / poetry
204+
run: python -m pip install pipenv poetry
205+
206+
- name: Install serverless
207+
run: npm install -g serverless@2
208+
209+
- name: Install dependencies
210+
if: steps.cacheNpm.outputs.cache-hit != 'true'
211+
run: |
212+
npm update --no-save
213+
npm update --save-dev --no-save
214+
- name: Unit tests
215+
run: script -e -c "npm test"
216+
217+
tagIfNewVersion:
218+
name: Tag if new version
219+
runs-on: ubuntu-latest
220+
needs: [linuxNode14, windowsNode14, linuxNode16, linuxNode12]
221+
steps:
222+
- name: Checkout repository
223+
uses: actions/checkout@v2
224+
with:
225+
# Ensure to have complete history of commits pushed with given push operation
226+
# It's loose and imperfect assumption that no more than 30 commits will be pushed at once
227+
fetch-depth: 30
228+
# Tag needs to be pushed with real user token, otherwise pushed tag won't trigger the actions workflow
229+
# Hence we're passing 'serverless-ci' user authentication token
230+
token: ${{ secrets.USER_GITHUB_TOKEN }}
231+
232+
- name: Tag if new version
233+
run: |
234+
NEW_VERSION=`git diff -U0 ${{ github.event.before }} package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || :
235+
if [ -n "$NEW_VERSION" ];
236+
then
237+
git tag v$NEW_VERSION
238+
git push --tags
239+
fi

0 commit comments

Comments
 (0)