loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'build: only require go minor' (#6151) from viceice/forgejo:build/pin-go-to-minor-only into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6151
Reviewed-by: Gusted <gusted@noreply.codeberg.org>

+61 -2
+59
.forgejo/workflows-composite/setup-cache-go/action.yaml
··· 1 + # SPDX-License-Identifier: MIT 2 + name: 'Forgejo Actions to setup Go and cache dependencies' 3 + author: 'Forgejo authors' 4 + description: | 5 + Wrap the setup-go with improved dependency caching. 6 + inputs: 7 + username: 8 + description: 'User for which to manage the dependency cache' 9 + default: root 10 + 11 + runs: 12 + using: "composite" 13 + steps: 14 + - name: "Install zstd for faster caching" 15 + run: | 16 + apt-get update -qq 17 + apt-get -q install -qq -y zstd 18 + 19 + - name: "Set up Go using setup-go" 20 + uses: https://code.forgejo.org/actions/setup-go@v5 21 + id: go-version 22 + with: 23 + go-version-file: "go.mod" 24 + # do not cache dependencies, we do this manually 25 + cache: false 26 + 27 + - name: "Get go environment information" 28 + id: go-environment 29 + run: | 30 + echo "modcache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT" 31 + echo "cache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT" 32 + env: 33 + RUN_AS_USER: ${{ inputs.username }} 34 + GO_VERSION: ${{ steps.go-version.outputs.go-version }} 35 + 36 + - name: "Create cache folders with correct permissions (for non-root users)" 37 + if: inputs.username != 'root' 38 + # when the cache is restored, only the permissions of the last part are restored 39 + # so assuming that /home/user exists and we are restoring /home/user/go/pkg/mod, 40 + # both folders will have the correct permissions, but 41 + # /home/user/go and /home/user/go/pkg might be owned by root 42 + run: | 43 + su ${RUN_AS_USER} -c 'mkdir -p "${MODCACHE_DIR}" "${CACHE_DIR}"' 44 + env: 45 + RUN_AS_USER: ${{ inputs.username }} 46 + MODCACHE_DIR: ${{ steps.go-environment.outputs.modcache }} 47 + CACHE_DIR: ${{ steps.go-environment.outputs.cache }} 48 + 49 + - name: "Restore Go dependencies from cache or mark for later caching" 50 + id: cache-deps 51 + uses: actions/cache@v4 52 + with: 53 + key: setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}-${{ hashFiles('go.sum', 'go.mod') }} 54 + restore-keys: | 55 + setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}- 56 + setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}- 57 + path: | 58 + ${{ steps.go-environment.outputs.modcache }} 59 + ${{ steps.go-environment.outputs.cache }}
+1 -1
.forgejo/workflows-composite/setup-env/action.yaml
··· 10 10 adduser --quiet --comment forgejo --disabled-password forgejo || true 11 11 chown -R forgejo:forgejo . 12 12 13 - - uses: https://codeberg.org/fnetx/setup-cache-go@4b50dd28b1068fa06d433c5fabed3f6f4d4ccddf 13 + - uses: ./.forgejo/workflows-composite/setup-cache-go 14 14 with: 15 15 username: forgejo 16 16
+1 -1
go.mod
··· 1 1 module code.gitea.io/gitea 2 2 3 - go 1.23.1 3 + go 1.23 4 4 5 5 toolchain go1.23.4 6 6