Skip to content

Commit

Permalink
Use ${{ github.workspace }} variable in CI (facebookincubator#10437)
Browse files Browse the repository at this point in the history
Summary:
This PR does some cleanup to replace hardcoded paths with `${{ github.workspace }}`. This helps make CI more robust on forks.

Pull Request resolved: facebookincubator#10437

Reviewed By: kgpai

Differential Revision: D60244260

Pulled By: Yuhta

fbshipit-source-id: f509dd7a77fac46755cfa1b6a05ac8ae44feea6e
  • Loading branch information
bdice authored and facebook-github-bot committed Jul 25, 2024
1 parent 0fe4db8 commit b9d0091
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory /__w/velox/velox
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}

- name: Make ${{ matrix.type }} Build
env:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,12 @@ jobs:
name: join
path: velox/_build/debug/velox/exec/tests/velox_join_fuzzer_test


presto-java-aggregation-fuzzer-run:
runs-on: 8-core-ubuntu
container: ghcr.io/facebookincubator/velox-dev:presto-java
timeout-minutes: 120
env:
CCACHE_DIR: "/__w/velox/velox/.ccache/"
CCACHE_DIR: "${{ github.workspace }}/.ccache/"
LINUX_DISTRO: "centos"
steps:

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run:
shell: bash
env:
CCACHE_DIR: "/__w/velox/velox/.ccache"
CCACHE_DIR: "${{ github.workspace }}/.ccache"
VELOX_DEPENDENCY_SOURCE: SYSTEM
Protobuf_SOURCE: BUNDLED # can be removed after #10134 is merged
simdjson_SOURCE: BUNDLED
Expand All @@ -70,7 +70,7 @@ jobs:
- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory /__w/velox/velox
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}

- name: Install Dependencies
run: |
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
# Some of the adapters dependencies are in the 'adapters' conda env
shell: mamba run --no-capture-output -n adapters /usr/bin/bash -e {0}
env:
LIBHDFS3_CONF: "/__w/velox/velox/scripts/hdfs-client.xml"
LIBHDFS3_CONF: "${{ github.workspace }}/scripts/hdfs-client.xml"
working-directory: _build/release
run: |
ctest -j 8 --output-on-failure --no-tests=error
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/preliminary_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fail-fast: false
matrix:
config:
- { name: "License Header",
- { name: "License Header",
command: "header-fix",
message: "Found missing License Header(s)",
}
Expand All @@ -50,9 +50,9 @@ jobs:
- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory /__w/velox/velox
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}

- name: Check ${{ matrix.config.name }}
- name: Check ${{ matrix.config.name }}
run: |
make ${{ matrix.config.command }}
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
container: ghcr.io/facebookincubator/velox-dev:centos9
timeout-minutes: 120
env:
CCACHE_DIR: "/__w/velox/velox/.ccache"
CCACHE_DIR: "${{ github.workspace }}/.ccache"
LINUX_DISTRO: "ubuntu"
MAKEFLAGS: "NUM_THREADS=${{ inputs.numThreads || 16 }} MAX_HIGH_MEM_JOBS=${{ inputs.maxHighMemJobs || 8 }} MAX_LINK_JOBS=${{ inputs.maxLinkJobs || 4 }}"

Expand Down Expand Up @@ -143,8 +143,8 @@ jobs:
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: |
git config --global --add safe.directory /__w/velox/velox/velox
git config --global --add safe.directory /__w/velox/velox/velox_main
git config --global --add safe.directory ${GITHUB_WORKSPACE}/velox
git config --global --add safe.directory ${GITHUB_WORKSPACE}/velox_main
- name: Ensure Stash Dirs Exists
working-directory: ${{ github.workspace }}
Expand Down Expand Up @@ -703,7 +703,7 @@ jobs:
- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory /__w/velox/velox/velox
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}/velox


- name: "Run Aggregate Fuzzer"
Expand Down Expand Up @@ -767,7 +767,7 @@ jobs:
- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory /__w/velox/velox/velox
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}/velox

- name: Download Signatures
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -864,7 +864,7 @@ jobs:
- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory /__w/velox/velox/velox
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}/velox


- name: "Run Window Fuzzer"
Expand Down Expand Up @@ -926,8 +926,7 @@ jobs:
- name: Fix git permissions
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory /__w/velox/velox/velox

run: git config --global --add safe.directory ${GITHUB_WORKSPACE}/velox

- name: "Run Writer Fuzzer"
run: |
Expand Down

0 comments on commit b9d0091

Please sign in to comment.