From c3b67373189e8b3d8c1cb3342ed82e34ca1bcd49 Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Sun, 9 Mar 2025 17:01:41 -0700 Subject: [PATCH] ci: cache Go, switch to forgejo actions fully --- .github/workflows/test.yaml | 19 +++++++++++++++++-- .github/workflows/update.yaml | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2114f8e..751030d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,12 +16,27 @@ jobs: elint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: jdx/mise-action@v2 + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://git.rgst.io/rgst-io/mise-action@v2 with: experimental: true + github_token: ${{ secrets.ACTUAL_GITHUB_TOKEN }} + - name: Get Go directories + id: go + run: | + echo "cache_dir=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "mod_cache_dir=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + - uses: https://code.forgejo.org/actions/cache@v4 + with: + path: ${{ steps.go.outputs.cache_dir }} + key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} + - uses: https://code.forgejo.org/actions/cache@v4 + with: + path: ${{ steps.go.outputs.mod_cache_dir }} + key: ${{ runner.os }}-go-mod-cache-${{ hashFiles('go.sum') }} - name: Setup Environment working-directory: .tools run: mise run build + - name: Run linter run: mise run lint diff --git a/.github/workflows/update.yaml b/.github/workflows/update.yaml index fb14f10..33621d9 100644 --- a/.github/workflows/update.yaml +++ b/.github/workflows/update.yaml @@ -16,13 +16,28 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v4 - - uses: jdx/mise-action@v2 + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://git.rgst.io/rgst-io/mise-action@v2 with: experimental: true + github_token: ${{ secrets.ACTUAL_GITHUB_TOKEN }} + - name: Get Go directories + id: go + run: | + echo "cache_dir=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "mod_cache_dir=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + - uses: https://code.forgejo.org/actions/cache@v4 + with: + path: ${{ steps.go.outputs.cache_dir }} + key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} + - uses: https://code.forgejo.org/actions/cache@v4 + with: + path: ${{ steps.go.outputs.mod_cache_dir }} + key: ${{ runner.os }}-go-mod-cache-${{ hashFiles('go.sum') }} - name: Setup Environment working-directory: .tools run: mise run build + - name: Run updater env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}