Run integration tests for 1.0 #4
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: Run integration tests for 1.0 | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Environment to run the tests against' | |
type: choice | |
required: true | |
default: 'dev' | |
options: | |
- dev | |
- staging | |
workflow_call: | |
inputs: | |
environment: | |
default: 'staging' | |
required: false | |
type: string | |
secrets: | |
FIREBOLT_USERNAME: | |
required: true | |
FIREBOLT_PASSWORD: | |
required: true | |
FIREBOLT_STG_USERNAME: | |
required: true | |
FIREBOLT_STG_PASSWORD: | |
required: true | |
SERVICE_ID: | |
required: true | |
SERVICE_SECRET: | |
required: true | |
SERVICE_ID_STG: | |
required: true | |
SERVICE_SECRET_STG: | |
required: true | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm install | |
- name: Determine env variables | |
run: | | |
if [ "${{ inputs.environment }}" == 'staging' ]; then | |
echo "USERNAME=${{ secrets.FIREBOLT_STG_USERNAME }}" >> "$GITHUB_ENV" | |
echo "PASSWORD=${{ secrets.FIREBOLT_STG_PASSWORD }}" >> "$GITHUB_ENV" | |
echo "CLIENT_ID=${{ secrets.SERVICE_ID_STG }}" >> "$GITHUB_ENV" | |
echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET_STG }}" >> "$GITHUB_ENV" | |
else | |
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV" | |
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV" | |
echo "CLIENT_ID=${{ secrets.SERVICE_ID }}" >> "$GITHUB_ENV" | |
echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET }}" >> "$GITHUB_ENV" | |
fi | |
- name: Setup database and engine | |
id: setup | |
uses: firebolt-db/integration-testing-setup@v1 | |
with: | |
firebolt-username: ${{ env.USERNAME }} | |
firebolt-password: ${{ env.PASSWORD }} | |
api-endpoint: "api.${{ inputs.environment }}.firebolt.io" | |
region: "us-east-1" | |
- name: Run integration tests | |
env: | |
FIREBOLT_USERNAME: ${{ env.USERNAME }} | |
FIREBOLT_PASSWORD: ${{ env.PASSWORD }} | |
FIREBOLT_DATABASE: ${{ steps.setup.outputs.database_name }} | |
FIREBOLT_ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} | |
FIREBOLT_ENGINE_ENDPOINT: ${{ steps.setup.outputs.engine_url }} | |
FIREBOLT_API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io" | |
FIREBOLT_CLIENT_ID: ${{ env.CLIENT_ID }} | |
FIREBOLT_CLIENT_SECRET: ${{ env.CLIENT_SECRET }} | |
run: | | |
npm run test:ci integration |