Explorar el Código

Fix nimble dependency caching in CI

Zed hace 3 meses
padre
commit
a8bc1bbb2d
Se han modificado 3 ficheros con 20 adiciones y 20 borrados
  1. 4 8
      .github/workflows/build-docker.yml
  2. 15 10
      .github/workflows/run-tests.yml
  3. 1 2
      nitter.nimble

+ 4 - 8
.github/workflows/build-docker.yml

@@ -7,6 +7,10 @@ on:
     branches:
       - master
 
+concurrency:
+  group: docker-publish-${{ github.ref }}
+  cancel-in-progress: true
+
 env:
   IMAGE: zedeus/nitter
 
@@ -15,8 +19,6 @@ jobs:
     uses: ./.github/workflows/run-tests.yml
     secrets: inherit
 
-  # Build each architecture natively (no emulation) and push by digest only.
-  # The digests are stitched into a single multi-arch tag by the merge job.
   build:
     needs: [tests]
     strategy:
@@ -55,8 +57,6 @@ jobs:
           file: ./Dockerfile
           platforms: ${{ matrix.platform }}
           outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=true
-          # Attestations turn a single-platform push into a manifest index, which
-          # breaks push-by-digest + the imagetools merge below. Disable them.
           provenance: false
           sbom: false
 
@@ -101,10 +101,6 @@ jobs:
       - name: Create manifest list and push
         working-directory: ${{ runner.temp }}/digests
         run: |
-          # latest-arm64 is a backward-compat alias of the (now multi-arch)
-          # latest tag, for users still pinned to the old ARM64-only image.
-          # word splitting is intentional: one image ref arg per digest file
-          # shellcheck disable=SC2046
           docker buildx imagetools create \
             -t ${{ env.IMAGE }}:latest \
             -t ${{ env.IMAGE }}:latest-arm64 \

+ 15 - 10
.github/workflows/run-tests.yml

@@ -32,10 +32,12 @@ jobs:
         id: cache-nimble
         uses: actions/cache@v5
         with:
-          path: ~/.nimble
-          key: ${{ matrix.nim }}-nimble-v3-${{ hashFiles('*.nimble') }}
+          path: |
+            ~/.nimble/pkgcache
+            ~/.nimble/packages_official.json
+          key: ${{ matrix.nim }}-nimble-v6-${{ hashFiles('*.nimble') }}
           restore-keys: |
-            ${{ matrix.nim }}-nimble-v3-
+            ${{ matrix.nim }}-nimble-v6-
 
       - name: Setup Nim
         uses: jiro4989/setup-nim-action@v2
@@ -103,10 +105,12 @@ jobs:
       - name: Cache Nimble Dependencies
         uses: actions/cache@v5
         with:
-          path: ~/.nimble
-          key: 2.2.x-nimble-v3-${{ hashFiles('*.nimble') }}
+          path: |
+            ~/.nimble/pkgcache
+            ~/.nimble/packages_official.json
+          key: 2.2.x-nimble-v6-${{ hashFiles('*.nimble') }}
           restore-keys: |
-            2.2.x-nimble-v3-
+            2.2.x-nimble-v6-
 
       - name: Setup Nim
         uses: jiro4989/setup-nim-action@v2
@@ -115,6 +119,9 @@ jobs:
           use-nightlies: true
           repo-token: ${{ secrets.GITHUB_TOKEN }}
 
+      - name: Install Nimble dependencies
+        run: nimble install -y --depsOnly
+
       - name: Download 2.2.x build artifact
         uses: actions/download-artifact@v4
         with:
@@ -130,10 +137,8 @@ jobs:
           sed -i 's/enableDebug = false/enableDebug = true/g' nitter.conf
           sed -i 's/maxRetries = 1/maxRetries = 10/g' nitter.conf
 
-          # Run both Nimble tasks concurrently
-          nim r tools/rendermd.nim &
-          nim r tools/gencss.nim &
-          wait
+          nim r tools/rendermd.nim
+          nim r tools/gencss.nim
 
           echo '${{ secrets.SESSIONS }}' | head -n1
           echo '${{ secrets.SESSIONS }}' > ./sessions.jsonl

+ 1 - 2
nitter.nimble

@@ -18,8 +18,7 @@ requires "nimcrypto#a079df9"
 requires "markdown#158efe3"
 requires "packedjson#9e6fbb6"
 requires "supersnappy#6c94198"
-requires "https://github.com/zedeus/redpool#8b7c1db"
-requires "https://github.com/zedeus/redis#d0a0e6f"
+requires "redpool >= 0.2.0"
 requires "zippy#ca5989a"
 requires "flatty#e668085"
 requires "jsony#1de1f08"