forgejo/.forgejo/workflows-composite/setup-env/action.yaml

26 lines
843 B
YAML
Raw Normal View History

# TODO:
# - [ ] prepare a forgejo ci image with the necessary tools and forgejo user
2024-09-27 20:44:22 +02:00
runs:
using: "composite"
steps:
- name: setup user and permissions
run: |
git config --add safe.directory '*'
# ignore if the user already exists (like with the playwright image)
adduser --quiet --comment forgejo --disabled-password forgejo || true
2024-09-27 20:44:22 +02:00
chown -R forgejo:forgejo .
- uses: https://codeberg.org/fnetx/setup-cache-go@4b50dd28b1068fa06d433c5fabed3f6f4d4ccddf
with:
username: forgejo
- name: validate go version
run: |
set -ex
toolchain=$(grep -oP '(?<=toolchain ).+' go.mod)
version=$(go version | cut -d' ' -f3)
if [ "$toolchain" != "$version" ]; then
echo "go version mismatch: $toolchain <> $version"
exit 1
fi