-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Update actions for both 1.0 and 2.0 support (#67)
- Loading branch information
1 parent
7c4a863
commit dc098d4
Showing
6 changed files
with
225 additions
and
88 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Run integration tests for 2.0 | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: 'Environment to run the tests against' | ||
type: choice | ||
required: true | ||
default: 'staging' | ||
options: | ||
- dev | ||
- staging | ||
workflow_call: | ||
inputs: | ||
environment: | ||
description: 'Environment to run the tests against' | ||
type: choice | ||
required: true | ||
default: 'staging' | ||
options: | ||
- dev | ||
- staging | ||
secrets: | ||
FIREBOLT_CLIENT_ID_STG_NEW_IDN: | ||
required: true | ||
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: | ||
required: true | ||
FIREBOLT_CLIENT_ID_NEW_IDN: | ||
required: true | ||
FIREBOLT_CLIENT_SECRET_NEW_IDN: | ||
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 "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" >> "$GITHUB_ENV" | ||
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" >> "$GITHUB_ENV" | ||
else | ||
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}" >> "$GITHUB_ENV" | ||
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}" >> "$GITHUB_ENV" | ||
fi | ||
- name: Setup database and engine | ||
id: setup | ||
uses: firebolt-db/integration-testing-setup@v2 | ||
with: | ||
firebolt-client-id: ${{ env.CLIENT_ID }} | ||
firebolt-client-secret: ${{ env.CLIENT_SECRET }} | ||
account: "developer" | ||
api-endpoint: "api.${{ inputs.environment }}.firebolt.io" | ||
region: "us-east-1" | ||
|
||
- name: Run integration tests | ||
env: | ||
FIREBOLT_ACCOUNT: "developer" | ||
FIREBOLT_DATABASE: ${{ steps.setup.outputs.database_name }} | ||
FIREBOLT_ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} | ||
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,68 @@ | ||
name: Run integration tests | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: 'Environment to run the tests against' | ||
type: choice | ||
required: true | ||
default: 'dev' | ||
options: | ||
- dev | ||
- staging | ||
workflow_call: | ||
inputs: | ||
branch: | ||
environment: | ||
default: 'staging' | ||
required: false | ||
type: string | ||
description: 'Branch to run on' | ||
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 | ||
# V2 secrets | ||
FIREBOLT_CLIENT_ID_STG_NEW_IDN: | ||
required: true | ||
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: | ||
required: true | ||
FIREBOLT_CLIENT_ID_NEW_IDN: | ||
required: true | ||
FIREBOLT_CLIENT_SECRET_NEW_IDN: | ||
required: true | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Set up node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
- name: Setup database and engine | ||
id: setup | ||
uses: firebolt-db/integration-testing-setup@v2 | ||
with: | ||
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }} | ||
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }} | ||
account: "developer" | ||
api-endpoint: "api.dev.firebolt.io" | ||
region: "us-east-1" | ||
integration-test-v1: | ||
uses: ./.github/workflows/integration-tests-v1.yml | ||
with: | ||
environment: ${{ inputs.environment }} | ||
secrets: | ||
FIREBOLT_USERNAME: ${{ secrets.FIREBOLT_USERNAME }} | ||
FIREBOLT_PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }} | ||
FIREBOLT_STG_USERNAME: ${{ secrets.FIREBOLT_STG_USERNAME }} | ||
FIREBOLT_STG_PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }} | ||
SERVICE_ID: ${{ secrets.SERVICE_ID }} | ||
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} | ||
SERVICE_ID_STG: ${{ secrets.SERVICE_ID_STG }} | ||
SERVICE_SECRET_STG: ${{ secrets.SERVICE_SECRET_STG }} | ||
integration-test-v2: | ||
uses: ./.github/workflows/integration-tests-v2.yml | ||
with: | ||
environment: ${{ inputs.environment }} | ||
secrets: | ||
FIREBOLT_CLIENT_ID_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} | ||
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }} | ||
FIREBOLT_CLIENT_ID_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }} | ||
FIREBOLT_CLIENT_SECRET_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }} | ||
|
||
- name: Run integration tests | ||
env: | ||
FIREBOLT_ACCOUNT: "developer" | ||
FIREBOLT_DATABASE: ${{ steps.setup.outputs.database_name }} | ||
FIREBOLT_ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} | ||
FIREBOLT_API_ENDPOINT: ${{ secrets.FIREBOLT_API_ENDPOINT }} | ||
FIREBOLT_CLIENT_ID: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }} | ||
FIREBOLT_CLIENT_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }} | ||
run: | | ||
npm run test:ci integration |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.