Test Transactional Client Libraries #220
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |