-
-
Notifications
You must be signed in to change notification settings - Fork 349
124 lines (115 loc) · 4.07 KB
/
build-and-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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Build, test, test all examples
on:
push:
pull_request:
branches: [master, 9.x.x]
workflow_dispatch:
env:
GIT_COMMIT: ${{ github.sha }}
GIT_REF: ${{ github.ref }}
ENABLE_FEATURE_V4: true
LOG_LEVEL: info
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x, 20.x]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: bash scripts/ci/build-and-test.sh
shell: bash
env:
SKIP_EXAMPLES: true
- run: scripts/ci/test-examples.sh
shell: bash
env:
SETUP_DIST_ONLY: true
## require jest-pact and mocha-pact to update peer deps
# - name: example_mocha
# run: cd examples/mocha && npm install --ignore-scripts && npm test
# - name: example_jest
# run: cd examples/jest && npm install --ignore-scripts && npm test
# passing
- name: example_e2e
run: cd examples/e2e && npm install --ignore-scripts && npm test
- name: example_graphql
run: cd examples/graphql && npm install --ignore-scripts && npm test
- name: example_messages
run: cd examples/messages && npm install --ignore-scripts && npm test
- name: example_serverless
run: cd examples/serverless && npm install --ignore-scripts && npm test
- name: example_typescript
run: cd examples/typescript && npm install --ignore-scripts && npm test
- name: example_v3_e2e
run: cd examples/v3/e2e && npm install --ignore-scripts && npm test
- name: example_v3_provider-state-injected
run: cd examples/v3/provider-state-injected && npm install --ignore-scripts && npm test
- name: example_v3_run-specific-verifications
run: cd examples/v3/run-specific-verifications && npm install --ignore-scripts && npm test
- name: example_v3_todo-consumer
run: cd examples/v3/todo-consumer && npm install --ignore-scripts && npm test
- name: example_v3_typescript
run: cd examples/v3/typescript && npm install --ignore-scripts && npm test
- name: example_v4_plugins
run: cd examples/v4/plugins && npm install --ignore-scripts && npm test
# - name: Upload dist folder
# if: runner.os == 'Linux'
# uses: actions/upload-artifact@v3
# with:
# path: dist
# examples:
# needs: [build-and-test]
# strategy:
# matrix:
# node-version: [16,18,20]
# os: [macos-latest, ubuntu-latest, windows-latest]
# example:
# [
# e2e,
# graphql,
# jest, # requires jest-pact updating
# messages,
# mocha, # requires mocha-pact updating
# serverless,
# typescript,
# v3/e2e,
# v3/provider-state-injected,
# v3/run-specific-verifications,
# v3/todo-consumer,
# v3/typescript,
# v4/plugins,
# ]
# fail-fast: false
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Download dist folder
# uses: actions/download-artifact@v3
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
# - run: scripts/ci/test-examples.sh
# shell: bash
# env:
# SETUP_DIST_ONLY: true
# if: matrix.example != 'jest' || matrix.example != 'mocha'
# - run: bash scripts/install-plugins.sh
# if: matrix.example == 'v4/plugins'
# - name: run example ${{ matrix.example }}
# run: |
# npm install --ignore-scripts
# npm test
# shell: bash
# working-directory: examples/${{ matrix.example }}