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] try to fix ci #9366

Merged
merged 13 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from 12 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
14 changes: 8 additions & 6 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ jobs:
name: Backend-Path-Filter
runs-on: ubuntu-latest
outputs:
ignore: ${{ steps.filter.outputs.ignore }}
not-ignore: ${{ steps.filter.outputs.not-ignore }}
steps:
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
id: filter
with:
filters: |
ignore:
- '(docs/**|dolphinscheduler-ui/**|dolphinscheduler-ui-next/**)'
not-ignore:
- '!(docs/**|dolphinscheduler-ui/**|dolphinscheduler-ui-next/**)'
build:
name: Backend-Build
needs: paths-filter
if: ${{ needs.paths-filter.outputs.ignore == 'false' }}
if: ${{ needs.paths-filter.outputs.not-ignore == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -81,13 +81,15 @@ jobs:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [ build ]
needs: [ build, paths-filter ]
kezhenxu94 marked this conversation as resolved.
Show resolved Hide resolved
if: always()
steps:
- name: Status
run: |
if [[ ${{ needs.build.result }} == 'success' || ${{ needs.paths-filter.outputs.ignore == 'true' }} ]]; then
if [[ ${{ needs.build.result }} == 'success' ]]; then
echo "Passed!"
elif [[ ${{ needs.paths-filter.outputs.not-ignore }} == 'false' ]]; then
echo "Skip Build!"
else
exit -1
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this 👇 would be easier to understand?

Suggested change
if [[ ${{ needs.build.result }} == 'success' ]]; then
echo "Passed!"
elif [[ ${{ needs.paths-filter.outputs.not-ignore }} == 'false' ]]; then
echo "Skip Build!"
else
exit -1
fi
if [[ ${{ needs.paths-filter.outputs.ignore }} == 'true' ]]; then
echo "Skip Build!"
exit 0
fi
if [[ ${{ needs.build.result }} != 'success' ]]; then
echo "Failed to build"
exit -1
fi
# If we need to add more condition in the future, we can simply add
if [[ ${{ needs.new.condition.result }} != 'success' ]]; then
echo "Failed to do some new stuff"
exit -1
fi

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better. I'll fix it.

14 changes: 8 additions & 6 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ jobs:
name: E2E-Path-Filter
runs-on: ubuntu-latest
outputs:
ignore: ${{ steps.filter.outputs.ignore }}
not-ignore: ${{ steps.filter.outputs.not-ignore }}
steps:
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
id: filter
with:
filters: |
ignore:
- '(docs/**)'
not-ignore:
- '!(docs/**)'
build:
name: E2E-Build
needs: paths-filter
if: ${{ needs.paths-filter.outputs.ignore == 'false' }}
if: ${{ needs.paths-filter.outputs.not-ignore == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand Down Expand Up @@ -155,13 +155,15 @@ jobs:
name: E2E
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [ e2e ]
needs: [ e2e, paths-filter ]
if: always()
steps:
- name: Status
run: |
if [[ ${{ needs.e2e.result }} == 'success' || ${{ needs.paths-filter.outputs.ignore == 'true' }} ]]; then
if [[ ${{ needs.e2e.result }} == 'success' ]]; then
echo "Passed!"
elif [[ ${{ needs.paths-filter.outputs.not-ignore }} == 'false' ]]; then
echo "Skip E2E!"
else
exit -1
fi
14 changes: 8 additions & 6 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ jobs:
name: Unit-Test-Path-Filter
runs-on: ubuntu-latest
outputs:
ignore: ${{ steps.filter.outputs.ignore }}
not-ignore: ${{ steps.filter.outputs.not-ignore }}
steps:
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
id: filter
with:
filters: |
ignore:
- '(docs/**)'
not-ignore:
- '!(docs/**)'
unit-test:
name: Unit-Test
needs: paths-filter
if: ${{ needs.paths-filter.outputs.ignore == 'false' }}
if: ${{ needs.paths-filter.outputs.not-ignore == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -114,13 +114,15 @@ jobs:
name: Unit Test
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [ unit-test ]
needs: [ unit-test, paths-filter ]
if: always()
steps:
- name: Status
run: |
if [[ ${{ needs.unit-test.result }} == 'success' || ${{ needs.paths-filter.outputs.ignore == 'true' }} ]]; then
if [[ ${{ needs.unit-test.result }} == 'success' ]]; then
echo "Passed!"
elif [[ ${{ needs.paths-filter.outputs.not-ignore }} == 'false' ]]; then
echo "Skip Unit Test!"
else
exit -1
fi