From db629f83dce039607baa15210230e41140cbdb62 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 16 Jul 2024 13:38:36 +0100 Subject: [PATCH] support cached pkglint build --- .github/workflows/pkglint.yaml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pkglint.yaml b/.github/workflows/pkglint.yaml index 011351be90ab..4c63081d94d0 100644 --- a/.github/workflows/pkglint.yaml +++ b/.github/workflows/pkglint.yaml @@ -1,5 +1,7 @@ name: Verify pkglint on: [push] +env: + PKGLINT_VERSION: v23.4.2 jobs: pkglint: runs-on: ubuntu-latest @@ -7,17 +9,40 @@ jobs: - name: Checkout pkgsrc uses: actions/checkout@v4 - - name: Checkout pkglint + - name: Look for cached build of pkglint ${{ env.PKGLINT_VERSION }} + id: pkglint-artifact + uses: LIT-Protocol/artifact-exists-action@v0 + with: + name: pkglint-${{ env.PKGLINT_VERSION }} + + - name: Download cached build of pkglint ${{ env.PKGLINT_VERSION }} + if: steps.pkglint-artifact.outputs.exists == 'true' + uses: actions/download-artifact@v4 + with: + name: pkglint-${{ env.PKGLINT_VERSION }} + + - name: Checkout pkglint ${{ env.PKGLINT_VERSION }} + if: steps.pkglint-artifact.outputs.exists == 'false' uses: actions/checkout@v4 with: repository: rillig/pkglint path: pkglint + ref: ${{ env.PKGLINT_VERSION }} - - name: Build latest pkglint + - name: Build pkglint ${{ env.PKGLINT_VERSION }} + if: steps.pkglint-artifact.outputs.exists == 'false' run: | cd pkglint/v23 go install -v ./... + - name: Save pkglint artifact + if: steps.pkglint-artifact.outputs.exists == 'false' + uses: actions/upload-artifact@v4 + with: + name: pkglint-${{ env.PKGLINT_VERSION }} + path: | + ~/go/bin/ + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44