Skip to content

Commit dc098d4

Browse files
ci: Update actions for both 1.0 and 2.0 support (#67)
1 parent 7c4a863 commit dc098d4

File tree

6 files changed

+225
-88
lines changed

6 files changed

+225
-88
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Run integration tests for 1.0
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
environment:
6+
description: 'Environment to run the tests against'
7+
type: choice
8+
required: true
9+
default: 'dev'
10+
options:
11+
- dev
12+
- staging
13+
workflow_call:
14+
inputs:
15+
environment:
16+
default: 'staging'
17+
required: false
18+
type: string
19+
secrets:
20+
FIREBOLT_USERNAME:
21+
required: true
22+
FIREBOLT_PASSWORD:
23+
required: true
24+
FIREBOLT_STG_USERNAME:
25+
required: true
26+
FIREBOLT_STG_PASSWORD:
27+
required: true
28+
SERVICE_ID:
29+
required: true
30+
SERVICE_SECRET:
31+
required: true
32+
SERVICE_ID_STG:
33+
required: true
34+
SERVICE_SECRET_STG:
35+
required: true
36+
jobs:
37+
tests:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Check out code
41+
uses: actions/checkout@v2
42+
43+
- name: Set up node.js
44+
uses: actions/setup-node@v2
45+
with:
46+
node-version: '16'
47+
48+
- name: Install dependencies
49+
run: npm install
50+
51+
- name: Determine env variables
52+
run: |
53+
if [ "${{ inputs.environment }}" == 'staging' ]; then
54+
echo "USERNAME=${{ secrets.FIREBOLT_STG_USERNAME }}" >> "$GITHUB_ENV"
55+
echo "PASSWORD=${{ secrets.FIREBOLT_STG_PASSWORD }}" >> "$GITHUB_ENV"
56+
echo "CLIENT_ID=${{ secrets.SERVICE_ID_STG }}" >> "$GITHUB_ENV"
57+
echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET_STG }}" >> "$GITHUB_ENV"
58+
else
59+
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV"
60+
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV"
61+
echo "CLIENT_ID=${{ secrets.SERVICE_ID }}" >> "$GITHUB_ENV"
62+
echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET }}" >> "$GITHUB_ENV"
63+
fi
64+
65+
- name: Setup database and engine
66+
id: setup
67+
uses: firebolt-db/integration-testing-setup@v1
68+
with:
69+
firebolt-username: ${{ env.USERNAME }}
70+
firebolt-password: ${{ env.PASSWORD }}
71+
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
72+
region: "us-east-1"
73+
74+
- name: Run integration tests
75+
env:
76+
FIREBOLT_USERNAME: ${{ env.USERNAME }}
77+
FIREBOLT_PASSWORD: ${{ env.PASSWORD }}
78+
FIREBOLT_DATABASE: ${{ steps.setup.outputs.database_name }}
79+
FIREBOLT_ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
80+
FIREBOLT_ENGINE_ENDPOINT: ${{ steps.setup.outputs.engine_url }}
81+
FIREBOLT_API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
82+
FIREBOLT_CLIENT_ID: ${{ env.CLIENT_ID }}
83+
FIREBOLT_CLIENT_SECRET: ${{ env.CLIENT_SECRET }}
84+
run: |
85+
npm run test:ci integration
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Run integration tests for 2.0
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
environment:
6+
description: 'Environment to run the tests against'
7+
type: choice
8+
required: true
9+
default: 'staging'
10+
options:
11+
- dev
12+
- staging
13+
workflow_call:
14+
inputs:
15+
environment:
16+
description: 'Environment to run the tests against'
17+
type: choice
18+
required: true
19+
default: 'staging'
20+
options:
21+
- dev
22+
- staging
23+
secrets:
24+
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
25+
required: true
26+
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
27+
required: true
28+
FIREBOLT_CLIENT_ID_NEW_IDN:
29+
required: true
30+
FIREBOLT_CLIENT_SECRET_NEW_IDN:
31+
required: true
32+
jobs:
33+
tests:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Check out code
37+
uses: actions/checkout@v2
38+
39+
- name: Set up node.js
40+
uses: actions/setup-node@v2
41+
with:
42+
node-version: '16'
43+
44+
- name: Install dependencies
45+
run: npm install
46+
47+
- name: Determine env variables
48+
run: |
49+
if [ "${{ inputs.environment }}" == 'staging' ]; then
50+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" >> "$GITHUB_ENV"
51+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" >> "$GITHUB_ENV"
52+
else
53+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}" >> "$GITHUB_ENV"
54+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}" >> "$GITHUB_ENV"
55+
fi
56+
57+
- name: Setup database and engine
58+
id: setup
59+
uses: firebolt-db/integration-testing-setup@v2
60+
with:
61+
firebolt-client-id: ${{ env.CLIENT_ID }}
62+
firebolt-client-secret: ${{ env.CLIENT_SECRET }}
63+
account: "developer"
64+
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
65+
region: "us-east-1"
66+
67+
- name: Run integration tests
68+
env:
69+
FIREBOLT_ACCOUNT: "developer"
70+
FIREBOLT_DATABASE: ${{ steps.setup.outputs.database_name }}
71+
FIREBOLT_ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
72+
FIREBOLT_API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
73+
FIREBOLT_CLIENT_ID: ${{ env.CLIENT_ID
74+
FIREBOLT_CLIENT_SECRET: ${{ env.CLIENT_SECRET }}
75+
run: |
76+
npm run test:ci integration

.github/workflows/integration-tests.yaml

Lines changed: 59 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,68 @@
11
name: Run integration tests
22
on:
33
workflow_dispatch:
4+
inputs:
5+
environment:
6+
description: 'Environment to run the tests against'
7+
type: choice
8+
required: true
9+
default: 'dev'
10+
options:
11+
- dev
12+
- staging
413
workflow_call:
514
inputs:
6-
branch:
15+
environment:
16+
default: 'staging'
717
required: false
818
type: string
9-
description: 'Branch to run on'
19+
secrets:
20+
FIREBOLT_USERNAME:
21+
required: true
22+
FIREBOLT_PASSWORD:
23+
required: true
24+
FIREBOLT_STG_USERNAME:
25+
required: true
26+
FIREBOLT_STG_PASSWORD:
27+
required: true
28+
SERVICE_ID:
29+
required: true
30+
SERVICE_SECRET:
31+
required: true
32+
SERVICE_ID_STG:
33+
required: true
34+
SERVICE_SECRET_STG:
35+
required: true
36+
# V2 secrets
37+
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
38+
required: true
39+
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
40+
required: true
41+
FIREBOLT_CLIENT_ID_NEW_IDN:
42+
required: true
43+
FIREBOLT_CLIENT_SECRET_NEW_IDN:
44+
required: true
1045
jobs:
11-
tests:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Check out code
15-
uses: actions/checkout@v2
16-
with:
17-
ref: ${{ inputs.branch }}
18-
19-
- name: Set up node.js
20-
uses: actions/setup-node@v2
21-
with:
22-
node-version: '16'
23-
24-
- name: Install dependencies
25-
run: npm install
26-
- name: Setup database and engine
27-
id: setup
28-
uses: firebolt-db/integration-testing-setup@v2
29-
with:
30-
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
31-
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
32-
account: "developer"
33-
api-endpoint: "api.dev.firebolt.io"
34-
region: "us-east-1"
46+
integration-test-v1:
47+
uses: ./.github/workflows/integration-tests-v1.yml
48+
with:
49+
environment: ${{ inputs.environment }}
50+
secrets:
51+
FIREBOLT_USERNAME: ${{ secrets.FIREBOLT_USERNAME }}
52+
FIREBOLT_PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
53+
FIREBOLT_STG_USERNAME: ${{ secrets.FIREBOLT_STG_USERNAME }}
54+
FIREBOLT_STG_PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}
55+
SERVICE_ID: ${{ secrets.SERVICE_ID }}
56+
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
57+
SERVICE_ID_STG: ${{ secrets.SERVICE_ID_STG }}
58+
SERVICE_SECRET_STG: ${{ secrets.SERVICE_SECRET_STG }}
59+
integration-test-v2:
60+
uses: ./.github/workflows/integration-tests-v2.yml
61+
with:
62+
environment: ${{ inputs.environment }}
63+
secrets:
64+
FIREBOLT_CLIENT_ID_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
65+
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
66+
FIREBOLT_CLIENT_ID_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
67+
FIREBOLT_CLIENT_SECRET_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
3568

36-
- name: Run integration tests
37-
env:
38-
FIREBOLT_ACCOUNT: "developer"
39-
FIREBOLT_DATABASE: ${{ steps.setup.outputs.database_name }}
40-
FIREBOLT_ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
41-
FIREBOLT_API_ENDPOINT: ${{ secrets.FIREBOLT_API_ENDPOINT }}
42-
FIREBOLT_CLIENT_ID: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
43-
FIREBOLT_CLIENT_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
44-
run: |
45-
npm run test:ci integration

.github/workflows/release-v0.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/release-workflow.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
name: Release new version
22

33
on:
4-
workflow_call:
4+
workflow_dispatch:
55
inputs:
66
majorRelease:
77
required: false
8-
type: string
98
description: 'Release as version. Example values are: minor, major, 5.6.1, 1.0.0. Leave empty for regular release.'
10-
branch:
11-
required: true
12-
type: string
13-
description: 'main or 0.x branch'
149
tag:
1510
required: false
16-
type: string
1711
description: 'Prerelease tag name. Leave empty for regular release.'
1812

1913
jobs:
20-
# integration-tests:
21-
# uses: ./.github/workflows/integration-tests.yaml
14+
integration-tests:
15+
uses: ./.github/workflows/integration-tests.yaml
2216

2317
publish:
2418
runs-on: ubuntu-latest
25-
# needs: integration-tests
19+
needs: integration-tests
2620
steps:
2721
- name: Check out code
2822
uses: actions/checkout@v2
2923
with:
3024
fetch-depth: 0
31-
ref: ${{ inputs.branch }}
3225
token: ${{ secrets.RELEASE_PAT }}
3326

3427
- name: Set up node.js
@@ -62,7 +55,7 @@ jobs:
6255
6356
- name: Push git tags
6457
run: |
65-
git push --follow-tags origin ${{ inputs.branch }}
58+
git push --follow-tags origin main
6659
6760
- name: Get latest tag
6861
id: tag_generation

.github/workflows/release.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)