mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
refactor: refactor integration test ci job (#6095)
* fix: remove dev feature diff check remove dev feature diff check * refactor: refactor alteration integration test ci job refactor alteration integration test ci job * fix: fix the dev feature disbaled integration tests fix the dev feature disabled integration tests * fix: fix alteration-compatibility-test fix alteration-compatibility-test
This commit is contained in:
parent
15953609bb
commit
2f456ff371
2 changed files with 4 additions and 40 deletions
|
@ -37,10 +37,10 @@ jobs:
|
|||
|
||||
if [ -n "$CHANGE_FILES" ]; then
|
||||
echo "$CHANGE_FILES"
|
||||
echo "::set-output name=has-alteration-changes::true"
|
||||
echo "has-alteration-changes=true" >> $GITHUB_OUTPUT
|
||||
echo "Alteration changes detected"
|
||||
else
|
||||
echo "::set-output name=has-alteration-changes::false"
|
||||
echo "has-alteration-changes=false" >> $GITHUB_OUTPUT
|
||||
echo "No alteration changes detected"
|
||||
fi
|
||||
|
||||
|
@ -50,7 +50,7 @@ jobs:
|
|||
if: ${{needs.check-alteration-changes.outputs.has-alteration-changes == 'true'}}
|
||||
env:
|
||||
INTEGRATION_TEST: true
|
||||
DEV_FEATURES_ENABLED: true
|
||||
DEV_FEATURES_ENABLED: false
|
||||
steps:
|
||||
- uses: logto-io/actions-package-logto-artifact@v2
|
||||
with:
|
||||
|
@ -67,7 +67,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
env:
|
||||
INTEGRATION_TEST: true
|
||||
DEV_FEATURES_ENABLED: true
|
||||
DEV_FEATURES_ENABLED: false
|
||||
DB_URL: postgres://postgres:postgres@localhost:5432/postgres
|
||||
|
||||
steps:
|
||||
|
|
|
@ -10,44 +10,8 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
detect-dev-feature-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
has-dev-feature-changes: ${{ steps.changes-detection.outputs.has-dev-feature-changes }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# compare the current codebase with HEAD and check if there are any new lines with isDevFeaturesEnabled
|
||||
- name: Get the diff and filter added lines
|
||||
run: |
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
BASE=$(git merge-base origin/${{github.base_ref}} HEAD)
|
||||
else
|
||||
BASE=${{ github.event.before }}
|
||||
fi
|
||||
|
||||
git diff $BASE --unified=0 | grep -E '^\+' > added_lines.txt
|
||||
|
||||
sed -i '/^+++ /d' added_lines.txt
|
||||
|
||||
- name: Check for isDevFeaturesEnabled in added lines
|
||||
id: changes-detection
|
||||
run: |
|
||||
if grep -q 'isDevFeaturesEnabled' added_lines.txt; then
|
||||
echo "Dev features enabled changes detected"
|
||||
echo "::set-output name=has-dev-feature-changes::true"
|
||||
else
|
||||
echo "No dev features enabled changes detected"
|
||||
echo "::set-output name=has-dev-feature-changes::false"
|
||||
fi
|
||||
|
||||
package:
|
||||
needs: detect-dev-feature-changes
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{needs.detect-dev-feature-changes.outputs.has-dev-feature-changes == 'true'}}
|
||||
env:
|
||||
INTEGRATION_TEST: true
|
||||
DEV_FEATURES_ENABLED: false
|
||||
|
|
Loading…
Add table
Reference in a new issue