Skip to content

Commit 8e14c1a

Browse files
author
Maciej Wilczyński
committed
Merge branch 'master' into layer-zip-cache
* master: (24 commits) chore: Remove Node16 tests chore: Remove dependabot chore: Reformat with eslint & prettier ci: Add commitlint job to CI ci: Introduce new CI publish workflow ci: Introduce integrate CI workflow ci: Update validate CI workflow refactor: Use `ServerlessError` in `pip` refactor: Use `ServerlessError` in `pipenv` refactor: Use `ServerlessError` in `poetry` refactor: Use `ServerlessError` in `docker` refactor: Cleanup and use `finally` for code simplification refactor: Ensure proper verbose progress logs refactor: Adapt `docker` for modern logs refactor: Adapt `inject` to modern logs refactor: Adapt `layer` to modern logs refactor: Adapt `pip` to modern logs refactor: Adapt `zip` to modern logs refactor: Adapt `shared` to modern logs refactor: Adapt `clean` to modern logs ...
2 parents 40c81d6 + 89b3bab commit 8e14c1a

25 files changed

+1417
-773
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/integrate.yml

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
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+
windowsNode14:
14+
name: '[Windows] Node.js v14: Unit tests'
15+
runs-on: windows-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-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
31+
restore-keys: npm-v14-${{ 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: 14.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: npm test
63+
64+
linuxNode14:
65+
name: '[Linux] Node.js 14: Unit tests'
66+
runs-on: ubuntu-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-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
82+
restore-keys: npm-v14-${{ 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: 14.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+
linuxNode12:
116+
name: '[Linux] Node.js v12: 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-v12-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
133+
restore-keys: npm-v12-${{ 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: 12.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: npm test
165+
166+
tagIfNewVersion:
167+
name: Tag if new version
168+
runs-on: ubuntu-latest
169+
needs: [windowsNode14, linuxNode14, linuxNode12]
170+
steps:
171+
- name: Checkout repository
172+
uses: actions/checkout@v2
173+
with:
174+
# Ensure to have complete history of commits pushed with given push operation
175+
# It's loose and imperfect assumption that no more than 30 commits will be pushed at once
176+
fetch-depth: 30
177+
# Tag needs to be pushed with real user token, otherwise pushed tag won't trigger the actions workflow
178+
# Hence we're passing 'serverless-ci' user authentication token
179+
token: ${{ secrets.USER_GITHUB_TOKEN }}
180+
181+
- name: Tag if new version
182+
run: |
183+
NEW_VERSION=`git diff -U0 ${{ github.event.before }} package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || :
184+
if [ -n "$NEW_VERSION" ];
185+
then
186+
git tag v$NEW_VERSION
187+
git push --tags
188+
fi

.github/workflows/lint.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,52 @@
1+
# Version tags only
2+
13
name: Publish
24

3-
on: [release]
5+
on:
6+
push:
7+
tags:
8+
- v[0-9]+.[0-9]+.[0-9]+
49

510
jobs:
6-
publish-npm:
11+
publish:
12+
name: Publish
713
runs-on: ubuntu-latest
14+
env:
15+
# It'll work with secrets.GITHUB_TOKEN (which is provided by GitHub unconditionally)
16+
# Still then release author would be "github-actions". It's better if it's dedicated repo bot
17+
GITHUB_TOKEN: ${{ secrets.USER_GITHUB_TOKEN }}
818
steps:
9-
- uses: actions/checkout@v2
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
- name: Retrieve node_modules from cache
23+
id: cacheNodeModules
24+
uses: actions/cache@v2
25+
with:
26+
path: |
27+
~/.npm
28+
node_modules
29+
key: npm-v14-${{ runner.os }}-refs/heads/master-${{ hashFiles('package.json') }}
1030

11-
- uses: actions/setup-node@v2
31+
- name: Install Node.js and npm
32+
uses: actions/setup-node@v1
1233
with:
13-
version: 14
14-
registry-url: https://registry.npmjs.org/
34+
node-version: 14.x
35+
registry-url: https://registry.npmjs.org
1536

16-
- run: npm publish
37+
- name: Publish new version
1738
env:
18-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
run: npm publish
41+
42+
# Note: No need to install dependencies as:
43+
# 1. We have retrieved cached `node_modules` for very same `package.json`
44+
# as stored with recent `master `build
45+
# 2. If for some reason cache retrieval fails `npx` will download and install
46+
# `github-release-from-cc-changelog`
47+
48+
- name: Publish release notes
49+
run: |
50+
TEMP_ARRAY=($(echo $GITHUB_REF | tr "/" "\n"))
51+
TAG=${TEMP_ARRAY[@]: -1}
52+
npx github-release-from-cc-changelog $TAG

.github/workflows/test.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)