WIP: Forgejo v1.21 #125

Draft
earl-warren wants to merge 5 commits from earl-warren/wip-v1.21 into main
5 changed files with 56 additions and 81 deletions

View file

@ -1,40 +0,0 @@
on:
pull_request:
push:
branches:
- 'main'
jobs:
actions:
runs-on: self-hosted
strategy:
matrix:
info:
- binary: https://codeberg.org/forgejo-experimental/forgejo/releases/download/v1.22.0-test/forgejo-1.22.0-test-linux-amd64
version: v1_22
tests: ${{ vars.V1_22_TESTS }}
- binary: https://codeberg.org/forgejo/forgejo/releases/download/v1.21.2-1/forgejo-1.21.2-1-linux-amd64
version: v1_21
tests: ${{ vars.V1_21_TESTS }}
- binary: https://codeberg.org/forgejo/forgejo/releases/download/v1.20.6-1/forgejo-1.20.6-1-linux-amd64
version: v1_20
tests: ${{ vars.V1_20_TESTS }}
steps:
- uses: actions/checkout@v4
- uses: https://code.forgejo.org/actions/setup-forgejo@v2
with:
install-only: true
- if: matrix.info.tests != 'none'
shell: bash
run: |
set -x
forgejo-binary.sh ensure_user forgejo
test "${{ matrix.info.binary }}"
test "${{ matrix.info.version }}"
export DIR=$(mktemp -d)
chown forgejo $DIR /srv
su -c "actions/run.sh ${{ matrix.info.binary }} ${{ matrix.info.version }} ${{ matrix.info.tests }}" forgejo

39
.forgejo/workflows/pr.yml Normal file
View file

@ -0,0 +1,39 @@
on:
pull_request:
jobs:
info:
runs-on: docker
container:
image: node:20-bookworm
steps:
- name: event
run: |
cat <<'EOF'
${{ toJSON(github.event) }}
EOF
actions:
runs-on: self-hosted
container:
image: node:20-bookworm
steps:
- uses: actions/checkout@v4
- uses: https://code.forgejo.org/actions/setup-forgejo@v2
with:
install-only: true
- shell: bash
run: |
set -x
forgejo-binary.sh ensure_user forgejo
export DIR=$(mktemp -d)
chown forgejo $DIR /srv
if test -f forgejo/binary-url ; then
su -c "actions/run.sh $(cat forgejo/binary-url) v1_22" forgejo
else
echo "forgejo/binary-url does not exist, do nothing"
fi

View file

@ -1,41 +0,0 @@
name: upgrade
on:
pull_request:
push:
branches:
- 'main'
jobs:
upgrade:
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- name: cache S3 binaries
id: S3
uses: https://code.forgejo.org/actions/cache@v3
with:
path: |
/usr/local/bin/minio
/usr/local/bin/mc
/usr/local/bin/garage
key: S3
- name: skip if S3 cache hit
if: steps.S3.outputs.cache-hit != 'true'
run: echo no hit
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
- run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
script=$(pwd)/forgejo/upgrades/test-upgrade.sh
$script run dependencies
$script clobber
su forgejo -c "$script test_upgrades"

View file

@ -1,4 +1,20 @@
forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token
#
# Verify that creating a new branch with the same SHA as the default branch
# does not change the ref associated with the schedule
#
# See https://codeberg.org/forgejo/forgejo/pulls/1941 for more information
#
function verify_ref() {
local ref=$(sqlite3 $DIR/forgejo-work-path/forgejo.db 'select ref from action_schedule')
test "${ref##*/}" = "main"
}
verify_ref
api=$url/api/v1
forgejo-curl.sh api_json --data '{"new_branch_name":"zzzz"}' $api/repos/root/example-cron/branches
verify_ref
# cron runs once per minute, give it three minutes max before declaring failure
if ! RETRY_DELAYS="30 30 30 30 30 30" forgejo.sh retry test -f /srv/example-cron-volume/DONE ; then
cat $FORGEJO_RUNNER_LOGS

1
forgejo/binary-url Normal file
View file

@ -0,0 +1 @@
https://codeberg.org/forgejo-integration/forgejo/releases/download/v1.21.10-0/forgejo-1.21.10-0-linux-amd64