Skip to content

Commit

Permalink
[apache#768] improvement(CI): Setting the workflow dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Heng Qin committed Jan 15, 2024
1 parent 3a770cc commit a59ec39
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 17 ]
timeout-minutes: 30
needs: changes
if: needs.changes.outputs.source_changes == 'true'
Expand All @@ -78,11 +75,11 @@ jobs:

- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
java-version: 8
distribution: 'temurin'

- name: Build with Gradle
run: ./gradlew build -PskipITs -PjdkVersion=${{ matrix.java-version }}
run: ./gradlew build -PskipITs -PjdkVersion=8

- name: Upload unit tests report
uses: actions/upload-artifact@v3
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
branches: [ "main", "branch-*" ]
pull_request:
branches: [ "main", "branch-*" ]
workflow_run:
workflows:
- build
types:
- completed

concurrency:
group: ${{ github.worklfow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -46,10 +51,24 @@ jobs:
outputs:
source_changes: ${{ steps.filter.outputs.source_changes }}

get_workflow_conclusion:
name: Lookup Conclusion of Workflow_Run Event
runs-on: ubuntu-latest
outputs:
conclusion: ${{ fromJson(steps.get_conclusion.outputs.data).conclusion }}
steps:
- name: Get Workflow Run
uses: octokit/request-action@v2.1.0
id: get_conclusion
with:
route: GET /repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Integration test for AMD64 architecture
test-amd64-arch:
needs: changes
if: needs.changes.outputs.source_changes == 'true'
needs: [changes, get_workflow_conclusion]
if: needs.changes.outputs.source_changes == 'true' && needs.get_workflow_conclusion.outputs.get_workflow_conclusion == 'success'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
Expand Down

0 comments on commit a59ec39

Please sign in to comment.