integration-test #1442
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
# --------------------------------------------------------------------------------------------- | |
# MIT License | |
# Copyright (c) 2021, Solace Corporation, Ricardo Gomez-Ulmke ([email protected]) | |
# --------------------------------------------------------------------------------------------- | |
name: integration-test | |
on: | |
# for testing | |
workflow_dispatch: | |
# production | |
schedule: | |
# # - cron: '0 7 * * MON' | |
- cron: '0 7 * * *' | |
pull_request: | |
branches: | |
- main | |
env: | |
DEBUG_FLAG: ${{ true }} | |
# DEBUG_FLAG: ${{ false }} | |
TEST_PLATFORM_DIR: "platform-api/api-implementation" | |
TEST_TEST_RUNNER_OUTPUT_DIR: "platform-api/api-implementation/test/integration/tmp" | |
TEST_OUTPUT_NAME: "api-implementation-test-integration" | |
jobs: | |
integration_test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
max-parallel: 1 | |
matrix: | |
node: [ '18' ] | |
defaults: | |
run: | |
working-directory: ${{ env.TEST_PLATFORM_DIR }} | |
steps: | |
- name: Check Auth | |
if: github.event_name == 'workflow_dispatch' && github.actor != 'ricardojosegomezulmke' && github.actor != '195858' && github.actor != 'NilsEckertSolace' | |
run: | | |
echo "not authorized" | |
echo '::set-output name=IS_AUTHORIZED::false' | |
id: auth | |
- name: Cancel Workflow | |
if: ${{ always() && steps.auth.outputs.IS_AUTHORIZED == 'false' }} | |
uses: andymckay/[email protected] | |
- name: Checkout OpenAPI code generator | |
uses: actions/checkout@v3 | |
with: | |
repository: solace-iot-team/openapi-typescript-codegen | |
path: openapi-typescript-codegen | |
- name: Checkout Platform API code | |
uses: actions/checkout@v3 | |
with: | |
path: platform-api | |
- name: env before install | |
if: env.DEBUG_FLAG == 'true' | |
run: | | |
echo "bash --version: "; bash --version | |
echo "node --version: "; node --version | |
echo "npm --version: "; npm --version | |
echo ">>> environment: TEST_* " | |
env | grep TEST | |
- name: Setup Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: env after install | |
if: env.DEBUG_FLAG == 'true' | |
run: | | |
echo "bash --version: "; bash --version | |
echo "node --version: "; node --version | |
echo "npm --version: "; npm --version | |
echo "docker --version"; docker --version | |
- name: Build OpenAPI code generator | |
run: | | |
npm ci | |
npm run build | |
working-directory: openapi-typescript-codegen | |
- name: Install Platform API dependencies | |
run: | | |
npm ci | |
npm link ../../openapi-typescript-codegen | |
- name: Run Tests | |
run: | | |
export APIM_INTEGRATION_TEST_SOLACE_CLOUD_URL=${{ secrets.SOLACE_CLOUD_URL }} | |
export APIM_INTEGRATION_TEST_SOLACE_CLOUD_TOKEN=${{ secrets.SOLACE_CLOUD_TOKEN }} | |
export APIM_INTEGRATION_TEST_SOLACE_EVENT_PORTAL_URL=${{ secrets.SOLACE_EVENT_PORTAL_URL }} | |
export APIM_INTEGRATION_TEST_SOLACE_EVENT_PORTAL_TOKEN=${{ secrets.SOLACE_EVENT_PORTAL_TOKEN }} | |
export APIM_INTEGRATION_TEST_PLATFORM_ADMIN_USER=${{ secrets.PLATFORM_ADMIN_USER }} | |
export APIM_INTEGRATION_TEST_PLATFORM_ADMIN_PASSWORD=${{ secrets.PLATFORM_ADMIN_PASSWORD }} | |
export APIM_SOLACE_PLATFORM_API_PROJECT_HOME="$GITHUB_WORKSPACE/platform-api" | |
test/integration/run.sh | |
- name: Archive logs | |
if: ${{ (failure() && !cancelled()) || (always() && (github.event_name=='workflow_dispatch' || env.DEBUG_FLAG=='true') ) }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.TEST_OUTPUT_NAME }} | |
path: ${{ github.workspace }}/${{ env.TEST_TEST_RUNNER_OUTPUT_DIR }} | |
if-no-files-found: error | |
### | |
# The End. |