From a8bc1bbb2d0828b932f5a6198e94f07b98bc210d Mon Sep 17 00:00:00 2001 From: Zed Date: Sun, 7 Jun 2026 03:41:40 +0200 Subject: [PATCH] Fix nimble dependency caching in CI --- .github/workflows/build-docker.yml | 12 ++++-------- .github/workflows/run-tests.yml | 25 +++++++++++++++---------- nitter.nimble | 3 +-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index f50cad7..20a15a0 100644 --- a/.github/workflows/build-docker.yml +++ b/.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 \ diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f70e8e5..dcfff52 100644 --- a/.github/workflows/run-tests.yml +++ b/.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 diff --git a/nitter.nimble b/nitter.nimble index 8e17353..ba0a8c2 100644 --- a/nitter.nimble +++ b/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"