-
-
Notifications
You must be signed in to change notification settings - Fork 49
54 lines (47 loc) · 1.6 KB
/
ci.yaml
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
name: CI
on:
pull_request:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
serverless: ['1', '2', '3']
node: [ '14', '15', '16', '18', '19' ]
name: CI (Node v${{ matrix.node }}, serverless@${{ matrix.serverless }})
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
always-auth: true
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm test
- name: Integration Tests
run: |
npm ci
# Some versions of npm install peer dependencies
npm i serverless@${{ matrix.serverless }}
npx serverless --version
npx serverless package --stage production
# Must match value of `TEST_VAR` in `.env.production`
cat .serverless/cloudformation-template-update-stack.json | grep cf5bb467-9052-4a34-b318-f6df31644229
working-directory: examples/simple-express-app
- name: publish
# Only publish (maybe) for one version of Node, and only on 'master'
if: ${{ matrix.node == 14 && matrix.serverless == '3' && github.ref == 'refs/heads/master' }}
run: npm run deploy
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Coveralls
# Only send coverage details for one version of Node
if: ${{ matrix.node == 14 }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}