-
Notifications
You must be signed in to change notification settings - Fork 24
88 lines (74 loc) · 1.91 KB
/
test.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
name: npmtest
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: npx [email protected] --check .
test:
needs: lint
strategy:
fail-fast: false
matrix:
tests:
[
"containers",
"containers-private",
"deploy",
"domains",
"functions",
"multi-region",
"provider",
"runtimes",
"shared",
"triggers",
]
node-version: ["18.x", "20.x"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up node ${{ matrix.node-version }}
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install Serverless Framework
run: npm install -g [email protected]
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test:${{ matrix.tests }}
env:
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
SCW_REGION: ${{ vars.SCW_REGION }}
SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }}
clean-up:
if: ${{ always() }}
needs: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up node 20.x
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
- name: Install Serverless Framework
run: npm install -g [email protected]
- name: Install dependencies
run: npm ci
- name: Run cleanup
run: npm run clean-up
env:
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }}