Skip to content

Commit

Permalink
Revert "CI: Fix clear_cache commit feat for PRs" [skip ci]
Browse files Browse the repository at this point in the history
Revert "CI: Enable clear cache feature using commit msg"
  • Loading branch information
AnirudhDagar committed May 9, 2023
1 parent c44475f commit d1427f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 26 deletions.
28 changes: 7 additions & 21 deletions .github/actions/setup_env_vars/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ runs:
run: |
short_sha=$(git rev-parse --short "$SHA")
echo "SHORT_SHA=$short_sha" >> $GITHUB_ENV
commit_msg="$(git show --no-patch --format=%B $short_sha)"
echo "COMMIT_MSG=$commit_msg" >> $GITHUB_ENV
if [[ "$commit_msg" == *"[clear_cache]"* ]]; then
echo "CLEAR_CACHE=true" >> $GITHUB_ENV
else
echo "CLEAR_CACHE=false" >> $GITHUB_ENV
fi
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
target_branch=${GITHUB_REF##*/}
Expand All @@ -34,6 +24,9 @@ runs:
IFS='-' read -ra name_parts <<< "$repo_name"
echo "LANG=${name_parts[1]}" >> $GITHUB_ENV
task="${repo_name}-${target_branch}"
echo "TASK=$task" >> $GITHUB_ENV
job_name=${repo_name}/${target_branch}
echo "JOB_NAME=$job_name" >> $GITHUB_ENV
Expand All @@ -49,16 +42,6 @@ runs:
run: |
short_sha=$(git rev-parse --short "$SHA")
echo "SHORT_SHA=$short_sha" >> $GITHUB_ENV
commit_msg="$(git show --no-patch --format=%B $short_sha)"
echo "COMMIT_MSG=$commit_msg" >> $GITHUB_ENV
if [[ "$commit_msg" == *"[clear_cache]"* ]]; then
echo "CLEAR_CACHE=true" >> $GITHUB_ENV
else
echo "CLEAR_CACHE=false" >> $GITHUB_ENV
fi
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
echo "TARGET_BRANCH=$target_branch" >> $GITHUB_ENV
Expand All @@ -69,5 +52,8 @@ runs:
IFS='-' read -ra name_parts <<< "$repo_name"
echo "LANG=${name_parts[1]}" >> $GITHUB_ENV
job_name=${repo_name}/${pr_number}/${short_sha}
task="${repo_name}-${target_branch}"
echo "TASK=$task" >> $GITHUB_ENV
job_name=${repo_name}/PR-${{ github.event.number }}/${short_sha}
echo "JOB_NAME=$job_name" >> $GITHUB_ENV
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
build_torch:
name: Build PyTorch
if: "!contains(github.event.head_commit.message, '[skip torch]') && !contains(github.event.head_commit.message, '[skip frameworks]')"
# needs: [sanity_check]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -32,7 +33,7 @@ jobs:
with:
job-type: ci-gpu-torch
job-name: D2L-Build-PyTorch
command: chmod +x ./.github/workflow_scripts/build_pytorch.sh && ./.github/workflow_scripts/build_pytorch.sh "${{ env.REPO_NAME }}" "${{ env.TARGET_BRANCH }}" "${{ env.CLEAR_CACHE }}"
command: chmod +x ./.github/workflow_scripts/build_pytorch.sh && ./.github/workflow_scripts/build_pytorch.sh '${{ env.REPO_NAME }}' '${{ env.TARGET_BRANCH }}'

build_tf:
name: Build Tensorflow
Expand All @@ -48,7 +49,7 @@ jobs:
with:
job-type: ci-gpu-tf
job-name: D2L-Build-Tensorflow
command: chmod +x ./.github/workflow_scripts/build_tf.sh && ./.github/workflow_scripts/build_tf.sh "${{ env.REPO_NAME }}" "${{ env.TARGET_BRANCH }}" "${{ env.CLEAR_CACHE }}"
command: chmod +x ./.github/workflow_scripts/build_tf.sh && ./.github/workflow_scripts/build_tf.sh '${{ env.REPO_NAME }}' '${{ env.TARGET_BRANCH }}'

build_jax:
name: Build JAX
Expand All @@ -64,7 +65,7 @@ jobs:
with:
job-type: ci-gpu-jax
job-name: D2L-Build-JAX
command: chmod +x ./.github/workflow_scripts/build_jax.sh && ./.github/workflow_scripts/build_jax.sh "${{ env.REPO_NAME }}" "${{ env.TARGET_BRANCH }}" "${{ env.CLEAR_CACHE }}"
command: chmod +x ./.github/workflow_scripts/build_jax.sh && ./.github/workflow_scripts/build_jax.sh '${{ env.REPO_NAME }}' '${{ env.TARGET_BRANCH }}'

build_mxnet:
name: Build MXNet
Expand All @@ -80,7 +81,7 @@ jobs:
with:
job-type: ci-gpu-mxnet
job-name: D2L-Build-MXNet
command: chmod +x ./.github/workflow_scripts/build_mxnet.sh && ./.github/workflow_scripts/build_mxnet.sh "${{ env.REPO_NAME }}" "${{ env.TARGET_BRANCH }}" "${{ env.CLEAR_CACHE }}"
command: chmod +x ./.github/workflow_scripts/build_mxnet.sh && ./.github/workflow_scripts/build_mxnet.sh '${{ env.REPO_NAME }}' '${{ env.TARGET_BRANCH }}'

build_and_deploy:
name: Build Website/PDF & Publish Preview/Release
Expand All @@ -103,7 +104,7 @@ jobs:
with:
job-type: ci-cpu
job-name: D2L-Builder
command: chmod +x ./.github/workflow_scripts/build_and_deploy.sh ./.github/workflow_scripts/build_html.sh && ./.github/workflow_scripts/build_and_deploy.sh "${{ env.REPO_NAME }}" "${{ env.TARGET_BRANCH }}" "${{ env.JOB_NAME }}" "${{ env.LANG }}"
command: chmod +x ./.github/workflow_scripts/build_and_deploy.sh ./.github/workflow_scripts/build_html.sh && ./.github/workflow_scripts/build_and_deploy.sh '${{ env.REPO_NAME }}' '${{ env.TARGET_BRANCH }}' '${{ env.JOB_NAME }}' '${{ env.LANG }}'
- name: Comment on PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: peter-evans/[email protected]
Expand Down

0 comments on commit d1427f6

Please sign in to comment.