-
Notifications
You must be signed in to change notification settings - Fork 68
201 lines (174 loc) · 6.87 KB
/
test-marketing.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Test Marketing Client Libraries
on:
workflow_run:
workflows: ["Validate and Generate Marketing Client Libraries"]
types:
- completed
jobs:
test-node:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
scope: '@mailchimp'
- name: Prepare Build & Publishing Tools
run: npm install
- uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
name: mailchimp-marketing-node.zip
path: zip
- name: Unzip build artifact
run: |
mkdir -p swagger-out/marketing-javascript
unzip zip/mailchimp-marketing-node.zip -d swagger-out/marketing-javascript
- name: Install client
working-directory: swagger-out/marketing-javascript
run: npm install
- name: Run test suite
run: npm run test -- MarketingTest.test.js
env:
MARKETING_API_KEY: ${{ secrets.MARKETING_API_KEY }}
MARKETING_ACCESS_TOKEN: ${{ secrets.MARKETING_ACCESS_TOKEN }}
MARKETING_SERVER: ${{ secrets.MARKETING_SERVER }}
test-php:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94
- uses: actions/checkout@v2
- name: Initialize Marketing Cache
id: init-cache-mc
uses: actions/cache@v1
with:
path: .cache
key: cache-dir
- uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
name: mailchimp-marketing-php.zip
path: zip
- name: Unzip build artifact
run: |
mkdir -p swagger-out/marketing-php
unzip zip/mailchimp-marketing-php.zip -d swagger-out/marketing-php
- uses: php-actions/composer@v5
with:
php_version: 7.4
command: install -d swagger-out/marketing-php/MailchimpMarketing
- name: Install client dependencies
run: |
wget -O phpunit https://phar.phpunit.de/phpunit-9.phar
chmod +x phpunit
./phpunit --version
- name: Run test suite
working-directory: tests/marketing-php
run: |
MARKETING_API_KEY=${{ secrets.MARKETING_API_KEY }} \
MARKETING_SERVER=${{ secrets.MARKETING_SERVER }} \
MARKETING_ACCESS_TOKEN=${{ secrets.MARKETING_ACCESS_TOKEN }} \
phpunit MarketingTest.php
env:
MARKETING_API_KEY: ${{ secrets.MARKETING_API_KEY }}
MARKETING_ACCESS_TOKEN: ${{ secrets.MARKETING_ACCESS_TOKEN }}
MARKETING_SERVER: ${{ secrets.MARKETING_SERVER }}
test-ruby:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94
- uses: actions/checkout@v2
- name: Initialize Marketing Cache
id: init-cache-mc
uses: actions/cache@v1
with:
path: .cache
key: cache-dir
- uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
name: mailchimp-marketing-ruby.zip
path: zip
- name: Unzip build artifact
run: |
mkdir -p swagger-out/marketing-ruby
unzip zip/mailchimp-marketing-ruby.zip -d swagger-out/marketing-ruby
- name: Set up Ruby 2.7
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Install client dependencies
run: gem install rspec
- name: Install client
working-directory: swagger-out/marketing-ruby
run: |
gem build MailchimpMarketing.gemspec --output=MailchimpMarketing-test.gem
gem install ./MailchimpMarketing-test.gem
- name: Run test suite
run: |
cd tests/marketing-ruby
MARKETING_API_KEY=${{ secrets.MARKETING_API_KEY }} \
MARKETING_SERVER=${{ secrets.MARKETING_SERVER }} \
MARKETING_ACCESS_TOKEN=${{ secrets.MARKETING_ACCESS_TOKEN }} \
rspec MarketingTest_spec.rb
env:
MARKETING_API_KEY: ${{ secrets.MARKETING_API_KEY }}
MARKETING_ACCESS_TOKEN: ${{ secrets.MARKETING_ACCESS_TOKEN }}
MARKETING_SERVER: ${{ secrets.MARKETING_SERVER }}
test-python:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94
- uses: actions/checkout@v2
- name: Initialize Marketing Cache
id: init-cache-mc
uses: actions/cache@v1
with:
path: .cache
key: cache-dir
- name: Install Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
name: mailchimp-marketing-python.zip
path: zip
- name: Unzip build artifact
run: |
mkdir -p swagger-out/marketing-python
unzip zip/mailchimp-marketing-python.zip -d swagger-out/marketing-python
- name: Install client dependencies
run: pip install -U python-dotenv
- name: Install client
working-directory: swagger-out/marketing-python
run: python3 setup.py install --user
- name: Run test suite
run: |
cd tests/marketing-python
MARKETING_API_KEY=${{ secrets.MARKETING_API_KEY }} \
MARKETING_SERVER=${{ secrets.MARKETING_SERVER }} \
MARKETING_ACCESS_TOKEN=${{ secrets.MARKETING_ACCESS_TOKEN }} \
python3 MarketingTest.py
env:
MARKETING_API_KEY: ${{ secrets.MARKETING_API_KEY }}
MARKETING_ACCESS_TOKEN: ${{ secrets.MARKETING_ACCESS_TOKEN }}
MARKETING_SERVER: ${{ secrets.MARKETING_SERVER }}
build:
runs-on: ubuntu-latest
steps:
- name: POST Staging Build Hook
run: curl -X POST -d {} ${{ env.NETLIFY_STAGING_BUILD_HOOK }}
env:
NETLIFY_STAGING_BUILD_HOOK: ${{ secrets.NETLIFY_STAGING_BUILD_HOOK }}