Skip to content

Commit

Permalink
Merge pull request #6140 from logto-io/gao-refactor-ci
Browse files Browse the repository at this point in the history
ci: refactor integration tests workflow
  • Loading branch information
gao-sun authored Jul 1, 2024
2 parents dd69c1c + e7cc05b commit 49fea7d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 50 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/alteration-compatibility-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
id: changes-detection
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE=$(git merge-base origin/${{github.base_ref}} HEAD)
BASE=$(git merge-base origin/${{ github.base_ref }} HEAD)
else
BASE=${{ github.event.before }}
fi
Expand All @@ -47,15 +47,15 @@ jobs:
package:
needs: check-alteration-changes
runs-on: ubuntu-latest
if: ${{needs.check-alteration-changes.outputs.has-alteration-changes == 'true'}}
if: ${{ needs.check-alteration-changes.outputs.has-alteration-changes == 'true' }}
env:
INTEGRATION_TEST: true
DEV_FEATURES_ENABLED: false
steps:
- uses: logto-io/actions-package-logto-artifact@v2
with:
artifact-name: alteration-integration-test-${{ github.sha }}
branch: ${{github.base_ref}}
branch: ${{ github.base_ref }}
pnpm-version: 9

run-logto:
Expand All @@ -73,8 +73,8 @@ jobs:
steps:
- uses: logto-io/actions-run-logto-integration-tests@v3
with:
branch: ${{github.base_ref}}
branch: ${{ github.base_ref }}
logto-artifact: alteration-integration-test-${{ github.sha }}
test-target: ${{ matrix.target }}
db-alteration-target: ${{github.head_ref}}
db-alteration-target: ${{ github.head_ref }}
pnpm-version: 9
40 changes: 0 additions & 40 deletions .github/workflows/dev-feature-disabled-integration-test.yml

This file was deleted.

15 changes: 10 additions & 5 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- "push-action/**"
pull_request:

concurrency:
Expand All @@ -13,32 +12,38 @@ concurrency:

jobs:
package:
strategy:
matrix:
# Run the integration tests with and without dev features enabled
dev-features-enabled: [true, false]
runs-on: ubuntu-latest
env:
INTEGRATION_TEST: true
DEV_FEATURES_ENABLED: true
DEV_FEATURES_ENABLED: ${{ matrix.dev-features-enabled }}

steps:
- uses: logto-io/actions-package-logto-artifact@v2
with:
artifact-name: integration-test-${{ github.sha }}
artifact-name: integration-test-${{ github.sha }}-dev-features-${{ matrix.dev-features-enabled }}
pnpm-version: 9

run-logto:
strategy:
fail-fast: false
matrix:
target: [api, experience, console]
# Run the integration tests with and without dev features enabled
dev-features-enabled: [true, false]
needs: package
runs-on: ubuntu-latest
env:
INTEGRATION_TEST: true
DEV_FEATURES_ENABLED: true
DEV_FEATURES_ENABLED: ${{ matrix.dev-features-enabled }}
DB_URL: postgres://postgres:postgres@localhost:5432/postgres

steps:
- uses: logto-io/actions-run-logto-integration-tests@v3
with:
logto-artifact: integration-test-${{ github.sha }}
logto-artifact: integration-test-${{ github.sha }}-dev-features-${{ env.DEV_FEATURES_ENABLED }}
test-target: ${{ matrix.target }}
pnpm-version: 9

0 comments on commit 49fea7d

Please sign in to comment.