-
Notifications
You must be signed in to change notification settings - Fork 68
189 lines (160 loc) · 6.16 KB
/
test-transactional.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
name: Test Transactional Client Libraries
on:
workflow_run:
workflows: ["Validate and Generate Transactional 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-transactional-node.zip
path: zip
- name: Unzip build artifact
run: |
mkdir -p swagger-out/transactional-javascript
unzip zip/mailchimp-transactional-node.zip -d swagger-out/transactional-javascript
- name: Install client
working-directory: swagger-out/transactional-javascript
run: npm install
- name: Run test suite
run: npm run test -- TransactionalTest.test.js
env:
TRANSACTIONAL_API_KEY: ${{ secrets.TRANSACTIONAL_API_KEY }}
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 Transactional 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-transactional-php.zip
path: zip
- name: Unzip build artifact
run: |
mkdir -p swagger-out/transactional-php
unzip zip/mailchimp-transactional-php.zip -d swagger-out/transactional-php
- uses: php-actions/composer@v5
with:
php_version: 7.4
command: install -d swagger-out/transactional-php/MailchimpTransactional
- 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/transactional-php
run: |
TRANSACTIONAL_API_KEY=${{ secrets.TRANSACTIONAL_API_KEY }} \
phpunit TransactionalTest.php
env:
TRANSACTIONAL_API_KEY: ${{ secrets.TRANSACTIONAL_API_KEY }}
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 Transactional 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-transactional-ruby.zip
path: zip
- name: Unzip build artifact
run: |
mkdir -p swagger-out/transactional-ruby
unzip zip/mailchimp-transactional-ruby.zip -d swagger-out/transactional-ruby
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Install client dependencies
run: gem install rspec
- name: Install client
working-directory: swagger-out/transactional-ruby
run: |
gem build MailchimpTransactional.gemspec --output=MailchimpTransactional-test.gem
gem install ./MailchimpTransactional-test.gem
- name: Run test suite
run: |
cd tests/transactional-ruby
TRANSACTIONAL_API_KEY=${{ secrets.TRANSACTIONAL_API_KEY }} \
rspec TransactionalTest_spec.rb
env:
TRANSACTIONAL_API_KEY: ${{ secrets.TRANSACTIONAL_API_KEY }}
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 Transactional 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-transactional-python.zip
path: zip
- name: Unzip build artifact
run: |
mkdir -p swagger-out/transactional-python
unzip zip/mailchimp-transactional-python.zip -d swagger-out/transactional-python
- name: Install client dependencies
run: pip install -U python-dotenv
- name: Install client
working-directory: swagger-out/transactional-python
run: python3 setup.py install --user
- name: Run test suite
run: |
cd tests/transactional-python
TRANSACTIONAL_API_KEY=${{ secrets.TRANSACTIONAL_API_KEY }} \
python3 TransactionalTest.py
env:
TRANSACTIONAL_API_KEY: ${{ secrets.TRANSACTIONAL_API_KEY }}
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 }}