Skip to content

Commit

Permalink
ci: Update actions for both 1.0 and 2.0 support (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepansergeevitch authored Jan 12, 2024
1 parent 7c4a863 commit dc098d4
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 88 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/integration-tests-v1.yaml
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
76 changes: 76 additions & 0 deletions .github/workflows/integration-tests-v2.yaml
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
95 changes: 59 additions & 36 deletions .github/workflows/integration-tests.yaml
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
20 changes: 0 additions & 20 deletions .github/workflows/release-v0.yaml

This file was deleted.

17 changes: 5 additions & 12 deletions .github/workflows/release-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
name: Release new version

on:
workflow_call:
workflow_dispatch:
inputs:
majorRelease:
required: false
type: string
description: 'Release as version. Example values are: minor, major, 5.6.1, 1.0.0. Leave empty for regular release.'
branch:
required: true
type: string
description: 'main or 0.x branch'
tag:
required: false
type: string
description: 'Prerelease tag name. Leave empty for regular release.'

jobs:
# integration-tests:
# uses: ./.github/workflows/integration-tests.yaml
integration-tests:
uses: ./.github/workflows/integration-tests.yaml

publish:
runs-on: ubuntu-latest
# needs: integration-tests
needs: integration-tests
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ inputs.branch }}
token: ${{ secrets.RELEASE_PAT }}

- name: Set up node.js
Expand Down Expand Up @@ -62,7 +55,7 @@ jobs:
- name: Push git tags
run: |
git push --follow-tags origin ${{ inputs.branch }}
git push --follow-tags origin main
- name: Get latest tag
id: tag_generation
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/release.yaml

This file was deleted.

0 comments on commit dc098d4

Please sign in to comment.