Skip to content

Commit

Permalink
pass build env through
Browse files Browse the repository at this point in the history
  • Loading branch information
ZainRizvi committed May 5, 2023
1 parent d671cef commit 0e582b3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/actions/pytest-cache-download/action.yml
Expand Up @@ -6,6 +6,9 @@ inputs:
cache_dir:
description: Path to the pytest cache directory, relative to $GITHUB_WORKSPACE. This is where the merged cache will be placed.
required: true
build_environment:
description: The build environment
required: true
github-token:
description: GITHUB_TOKEN
required: true
Expand All @@ -30,17 +33,15 @@ runs:
shell: bash
env:
CACHE_DIR: ${{ inputs.cache_dir }}
WORKFLOW: ${{ github.workflow }}
JOB: ${{ github.job }}
JOB_IDENTIFIER: ${{ github.workflow}_${{ github.job }}_${{ inputs.build_environment }}
SHARD: ${{ inputs.shard }}
run: |
set +x
echo "all the commands sent to the below script:"
echo "cache_dir: $GITHUB_WORKSPACE/$CACHE_DIR"
echo "pr_identifier: $GITHUB_REF"
echo "workflow: $WORKFLOW"
echo "job: $JOB"
echo "JOB_IDENTIFIER: $JOB_IDENTIFIER"
echo "shard: $SHARD"
echo "temp_dir: $RUNNER_TEMP"
Expand All @@ -49,6 +50,5 @@ runs:
--download \
--cache_dir $GITHUB_WORKSPACE/$CACHE_DIR \
--pr_identifier $GITHUB_REF \
--workflow $WORKFLOW \
--job $JOB \
--job_identifier $JOB_IDENTIFIER \
--temp_dir $RUNNER_TEMP \
12 changes: 6 additions & 6 deletions .github/actions/pytest-cache-upload/action.yml
Expand Up @@ -10,6 +10,9 @@ inputs:
description: Shard number for the current job
required: false
default: "0"
build_environment:
description: The build environment
required: true
github-token:
description: GITHUB_TOKEN
required: true
Expand All @@ -34,25 +37,22 @@ runs:
shell: bash
env:
CACHE_DIR: ${{ inputs.cache_dir }}
WORKFLOW: ${{ github.workflow }}
JOB: ${{ github.job }}
JOB_IDENTIFIER: ${{ github.workflow}_${{ github.job }}_${{ inputs.build_environment }}
SHARD: ${{ inputs.shard }}
run: |
set -x
echo "all the commands sent to the below script:"
echo "cache_dir: $GITHUB_WORKSPACE/$CACHE_DIR"
echo "pr_identifier: $GITHUB_REF"
echo "workflow: $WORKFLOW"
echo "job: $JOB"
echo "JOB_IDENTIFIER: $JOB_IDENTIFIER"
echo "shard: $SHARD"
echo "temp_dir: $RUNNER_TEMP"
python3 .github/scripts/pytest_cache.py \
--upload \
--cache_dir $GITHUB_WORKSPACE/$CACHE_DIR \
--pr_identifier $GITHUB_REF \
--workflow $WORKFLOW \
--job $JOB \
--job_identifier $JOB_IDENTIFIER \
--shard $SHARD \
--temp_dir $RUNNER_TEMP \
1 change: 1 addition & 0 deletions .github/workflows/_linux-build.yml
Expand Up @@ -117,6 +117,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache_dir: .pytest_cache
build_environment: ${{ inputs.build-environment }}

# Apply the filter logic to the build step too if the test-config label is already there
- name: Select all requested test configurations (if the test matrix is available)
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/_linux-test.yml
Expand Up @@ -120,6 +120,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache_dir: .pytest_cache
build_environment: ${{ inputs.build-environment }}

- name: Set Test step time
id: test-timeout
Expand Down Expand Up @@ -236,6 +237,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache_dir: .pytest_cache
shard: ${{ matrix.shard }}
build_environment: ${{ inputs.build-environment }}

- name: Print remaining test logs
shell: bash
Expand Down

0 comments on commit 0e582b3

Please sign in to comment.