Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update actions for both 1.0 and 2.0 support #67

Merged
merged 4 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/integration-tests-v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
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
with:
ref: ${{ inputs.branch }}
stepansergeevitch marked this conversation as resolved.
Show resolved Hide resolved
stepansergeevitch marked this conversation as resolved.
Show resolved Hide resolved

- 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
86 changes: 86 additions & 0 deletions .github/workflows/integration-tests-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Run integration tests for 2.0
on:
workflow_dispatch:
inputs:
branch:
required: false
type: string
description: 'Branch to run on'
environment:
description: 'Environment to run the tests against'
type: choice
required: true
default: 'staging'
options:
- dev
- staging
workflow_call:
inputs:
branch:
required: false
type: string
description: 'Branch to run on'
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
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: 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
20 changes: 0 additions & 20 deletions .github/workflows/release-v0.yaml

This file was deleted.

18 changes: 6 additions & 12 deletions .github/workflows/release-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
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
stepansergeevitch marked this conversation as resolved.
Show resolved Hide resolved
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 }}
ref: main
stepansergeevitch marked this conversation as resolved.
Show resolved Hide resolved
token: ${{ secrets.RELEASE_PAT }}

- name: Set up node.js
Expand Down Expand Up @@ -62,7 +56,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.

Loading