integ-test #856
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) 2022, Solace Corporation, Nils Eckert ([email protected]) | |
# --------------------------------------------------------------------------------------------- | |
name: integ-test | |
on: | |
# for testing | |
workflow_dispatch: | |
# production | |
schedule: | |
- cron: '0 7 * * *' | |
pull_request: | |
branches: | |
- main | |
env: | |
PLATFORM_API_HOME: "platform-api/api-implementation" | |
jobs: | |
run-tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [ '18.x' ] | |
env: | |
TEST_DIRECTORY: "test" | |
defaults: | |
run: | |
working-directory: ${{ env.PLATFORM_API_HOME }} | |
steps: | |
- name: Cancel job if user has insufficient permissions | |
if: github.event_name == 'workflow_dispatch' && github.actor != 'NilsEckertSolace' && github.actor != 'ricardojosegomezulmke' && github.actor != '195858' | |
uses: andymckay/[email protected] | |
- name: Checkout OpenAPI code generator | |
uses: actions/checkout@v4 | |
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: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-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: Generate OpenAPI client | |
run: | | |
$TEST_DIRECTORY/generate.openapi-client.sh | |
- name: Execute Platform API tests | |
run: | | |
export PLATFORM_API_TEST_SOLACE_CLOUD_URL=${{ secrets.SOLACE_CLOUD_URL }} | |
export PLATFORM_API_TEST_SOLACE_CLOUD_TOKEN=${{ secrets.SOLACE_CLOUD_TOKEN }} | |
export PLATFORM_API_TEST_SOLACE_EVENT_PORTAL_URL=${{ secrets.SOLACE_EVENT_PORTAL_URL }} | |
export PLATFORM_API_TEST_SOLACE_EVENT_PORTAL_TOKEN=${{ secrets.SOLACE_EVENT_PORTAL_TOKEN }} | |
export PLATFORM_API_TEST_PLATFORM_ADMIN_USER=${{ secrets.PLATFORM_ADMIN_USER }} | |
export PLATFORM_API_TEST_PLATFORM_ADMIN_PASSWORD=${{ secrets.PLATFORM_ADMIN_PASSWORD }} | |
export PLATFORM_API_PROJECT_HOME="${{ github.workspace }}/platform-api" | |
export NODE_ENV=development | |
$TEST_DIRECTORY/integ/run.sh | |
- name: Archive logs | |
if: ${{ (failure() && !cancelled()) || (always() && github.event_name == 'workflow_dispatch') }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: integ-test-logs | |
path: ${{ github.workspace }}/${{ env.PLATFORM_API_HOME }}/${{ env.TEST_DIRECTORY }}/tmp | |
if-no-files-found: error | |
### | |
# The end |