Parcourir la source

Backport PR #10794: Clean up Link Caching Again (#10799)

Co-authored-by: Afshin Taylor Darian <git@darian.af>
MeeseeksMachine il y a 3 ans
Parent
commit
10ff1f5bf5
3 fichiers modifiés avec 18 ajouts et 38 suppressions
  1. 18 0
      .github/workflows/check-release.yml
  2. 0 9
      .github/workflows/linuxtests.yml
  3. 0 29
      scripts/ci_script.sh

+ 18 - 0
.github/workflows/check-release.yml

@@ -12,6 +12,9 @@ jobs:
 
   check_release:
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        group: [check_release, link_check]
     steps:
       - name: Checkout
         uses: actions/checkout@v2
@@ -53,14 +56,29 @@ jobs:
             ${{ runner.os }}-pip-
             ${{ runner.os }}-pip-
 
+      - name: Cache checked links build
+        uses: actions/cache@v2
+        if: ${{ matrix.group == 'link_check' }}
+        with:
+          path: ~/.cache/pytest-link-check
+          key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.rst', '**/*.md') }}-changelog
+          restore-keys: |
+            ${{ runner.os }}-linkcheck-
+
       - name: Check Release
+        if: ${{ matrix.group == 'check_release' }}
         uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
         env:
           RH_VERSION_SPEC: patch
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
 
+      - name: Run Link Check
+        if: ${{ matrix.group == 'link_check' }}
+        uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1
+
       - name: Upload Assets
+        if: ${{ matrix.group == 'check_release' }}
         uses: actions/upload-artifact@v2
         with:
           name: dist-files

+ 0 - 9
.github/workflows/linuxtests.yml

@@ -82,15 +82,6 @@ jobs:
           restore-keys: |
             ${{ runner.os }}-yarn-
 
-      - name: Cache checked links build
-        uses: actions/cache@v2
-        if: ${{ matrix.group == 'linkcheck' }}
-        with:
-          path: ~/.cache/pytest-link-check
-          key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.rst', '**/*.md') }}-changelog
-          restore-keys: |
-            ${{ runner.os }}-linkcheck-
-
       - name: Install dependencies
         env:
           GROUP: ${{ matrix.group }}

+ 0 - 29
scripts/ci_script.sh

@@ -48,35 +48,6 @@ if [[ $GROUP == docs ]]; then
     popd
 fi
 
-if [[ $GROUP == linkcheck ]]; then
-    # Run the link check using the jupyter-releaser CLI
-
-    # Set up caching
-    CACHE_DIR="${HOME}/.cache/pytest-link-check"
-    mkdir -p ${CACHE_DIR}
-    echo "Existing cache:"
-    ls -ltr ${CACHE_DIR}
-
-    # Set up env variables for releaser
-    export RH_CACHE_FILE=${CACHE_DIR}/cache
-    # Expire links after a week
-    export RH_LINKS_EXPIRE=604800
-
-    # Handle the branch
-    if [ ! -z ${GITHUB_BASE_REF} ]; then
-      echo "Using GITHUB_BASE_REF: ${GITHUB_BASE_REF}"
-      export RH_BRANCH=${GITHUB_BASE_REF}
-    else
-      # e.g refs/head/foo or refs/tag/bar
-      echo "Using GITHUB_REF: ${GITHUB_REF}"
-      export RH_BRANCH=$(echo ${GITHUB_REF} | cut -d'/' -f 3)
-    fi
-
-    pip install jupyter_releaser
-    jupyter-releaser prep-git
-    jupyter-releaser check-links
-fi
-
 
 if [[ $GROUP == integrity ]]; then
     # Run the integrity script first