Skip to content

Commit

Permalink
Fix GH Actions for doc-only PR
Browse files Browse the repository at this point in the history
When there is no code change, some steps in the GA workflow can't
run and cause errors. Put the `if condition` to check the code
change in those steps.

Signed-off-by: Yihong Wang <[email protected]>
  • Loading branch information
yhwang committed Feb 13, 2025
1 parent d08c27e commit 089fcf8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/arrow-flight-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: arrow flight tests

on:
pull_request:
paths-ignore:
- 'presto-docs/**'

env:
CONTINUOUS_INTEGRATION: true
Expand All @@ -12,22 +14,8 @@ env:
RETRY: .github/bin/retry

jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
codechange: ${{ steps.filter.outputs.codechange }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
codechange:
- '!presto-docs/**'
test:
runs-on: ubuntu-latest
needs: changes
strategy:
fail-fast: false
matrix:
Expand All @@ -42,13 +30,11 @@ jobs:
steps:
# Checkout the code only if there are changes in the relevant files
- uses: actions/checkout@v4
if: needs.changes.outputs.codechange == 'true'
with:
show-progress: false

# Set up Java and dependencies for the build environment
- uses: actions/setup-java@v4
if: needs.changes.outputs.codechange == 'true'
with:
distribution: 'temurin'
java-version: 8
Expand All @@ -58,12 +44,10 @@ jobs:

# Install dependencies for the target module
- name: Maven Install
if: needs.changes.outputs.codechange == 'true'
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
./mvnw install ${MAVEN_FAST_INSTALL} -am -pl ${{ matrix.modules }}
# Run Maven tests for the target module
- name: Maven Tests
if: needs.changes.outputs.codechange == 'true'
run: ./mvnw test ${MAVEN_TEST} -pl ${{ matrix.modules }}
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ jobs:
with:
show-progress: false
- uses: actions/setup-java@v4
if: needs.changes.outputs.codechange == 'true'
with:
distribution: 'temurin'
java-version: 8
cache: 'maven'
- name: Download nodejs to maven cache
if: needs.changes.outputs.codechange == 'true'
run: .github/bin/download_nodejs
- name: Maven Install
if: needs.changes.outputs.codechange == 'true'
Expand Down

0 comments on commit 089fcf8

Please sign in to comment.