cascading-pr from https://codeberg.org/forgejo/forgejo refs/pull/3059/head to forgejo/forgejo-3059 #146
|
@ -54,17 +54,6 @@ jobs:
|
||||||
name: forgejo-dev
|
name: forgejo-dev
|
||||||
path: /tmp/forgejo-upload
|
path: /tmp/forgejo-upload
|
||||||
|
|
||||||
packages:
|
|
||||||
needs: [build]
|
|
||||||
runs-on: lxc-bookworm
|
|
||||||
steps:
|
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
||||||
- uses: ./.forgejo/prepare-end-to-end
|
|
||||||
- run: su forgejo -c "./end-to-end.sh test_packages"
|
|
||||||
- name: full logs
|
|
||||||
if: always()
|
|
||||||
run: su forgejo -c "./end-to-end.sh show_logs"
|
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
needs: [build]
|
needs: [build]
|
||||||
runs-on: lxc-bookworm
|
runs-on: lxc-bookworm
|
||||||
|
@ -75,59 +64,3 @@ jobs:
|
||||||
- name: full logs
|
- name: full logs
|
||||||
if: always()
|
if: always()
|
||||||
run: su forgejo -c "./end-to-end.sh show_logs"
|
run: su forgejo -c "./end-to-end.sh show_logs"
|
||||||
|
|
||||||
actions-docs:
|
|
||||||
needs: [build]
|
|
||||||
runs-on: lxc-bookworm
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
info:
|
|
||||||
- version: "7.0"
|
|
||||||
branch: next
|
|
||||||
forgejo: https://codeberg.org
|
|
||||||
owner: forgejo-experimental
|
|
||||||
- version: "1.21"
|
|
||||||
forgejo: https://codeberg.org
|
|
||||||
owner: forgejo
|
|
||||||
steps:
|
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
||||||
- uses: ./.forgejo/prepare-end-to-end
|
|
||||||
- name: set full-version
|
|
||||||
id: full-version
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -x
|
|
||||||
full_version=$(./end-to-end.sh full_version ${{ matrix.info.version }} ${{ matrix.info.owner }})
|
|
||||||
echo value="$full_version" >> $GITHUB_OUTPUT
|
|
||||||
- run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.info.version }}"
|
|
||||||
- name: update documentation
|
|
||||||
uses: https://code.forgejo.org/actions/cascading-pr@v2.1
|
|
||||||
with:
|
|
||||||
origin-url: ${{ env.GITHUB_SERVER_URL }}
|
|
||||||
origin-repo: ${{ github.repository }}
|
|
||||||
origin-token: ${{ secrets.CASCADE_DOCS_ORIGIN_TOKEN }}
|
|
||||||
origin-ref: refs/heads/main
|
|
||||||
destination-url: https://codeberg.org
|
|
||||||
destination-fork-repo: ${{ vars.CASCADE_DOCS_DESTINATION_DOER }}/docs
|
|
||||||
destination-repo: forgejo/docs
|
|
||||||
destination-branch: ${{ matrix.info.branch || format('v{0}', matrix.info.version) }}
|
|
||||||
destination-token: ${{ secrets.CASCADE_DOCS_DESTINATION_TOKEN }}
|
|
||||||
prefix: ${{ env.GITHUB_REPOSITORY }}-${{ matrix.info.version }}
|
|
||||||
update: .forgejo/cascading-docs
|
|
||||||
env:
|
|
||||||
FORCE_VERSION: "${{ vars.CASCADE_DOCS_FORCE_VERSION }}"
|
|
||||||
VERSION: "${{ steps.full-version.outputs.value }}"
|
|
||||||
|
|
||||||
upgrade:
|
|
||||||
name: upgrade and storage
|
|
||||||
needs: [build]
|
|
||||||
runs-on: lxc-bookworm
|
|
||||||
steps:
|
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
||||||
- uses: ./.forgejo/prepare-end-to-end
|
|
||||||
- run: su forgejo -c "./end-to-end.sh test_upgrades"
|
|
||||||
- run: su forgejo -c "./end-to-end.sh test_storage"
|
|
||||||
- name: full logs
|
|
||||||
if: always()
|
|
||||||
run: su forgejo -c "./end-to-end.sh show_logs"
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ ACTIONS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
function actions_verify_example() {
|
function actions_verify_example() {
|
||||||
local example=$1
|
local example=$1
|
||||||
|
|
||||||
|
export HOST_PORT
|
||||||
export url=http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT}
|
export url=http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT}
|
||||||
export token=$(cat $DOT_FORGEJO_CURL/token)
|
export token=$(cat $DOT_FORGEJO_CURL/token)
|
||||||
|
|
||||||
|
@ -87,7 +88,7 @@ function actions_runner_version() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_actions() {
|
function test_actions() {
|
||||||
local versions="${1:-1.20 1.21 $RELEASE_NUMBERS_AND_DEV}"
|
local versions=8.0-dev
|
||||||
|
|
||||||
for version in $versions ; do
|
for version in $versions ; do
|
||||||
|
|
||||||
|
@ -96,20 +97,11 @@ function test_actions() {
|
||||||
|
|
||||||
log_info "Testing actions with Forgejo $version & Forgejo runner $runner_version"
|
log_info "Testing actions with Forgejo $version & Forgejo runner $runner_version"
|
||||||
|
|
||||||
if dpkg --compare-versions $version ge 7.0 && dpkg --compare-versions $runner_version gt 3.3.0 ; then
|
if dpkg --compare-versions $version ge 7.0 ; then
|
||||||
for example in artifacts-v4 ; do
|
for example in 7-0-schedule ; do
|
||||||
run actions_verify_example $example
|
run actions_verify_example $example
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for example in echo checkout service container expression local-action docker-action if if-fail ; do
|
|
||||||
run actions_verify_example $example
|
|
||||||
done
|
|
||||||
|
|
||||||
if dpkg --compare-versions $version gt 1.20 ; then
|
|
||||||
for example in push tag push-cancel artifacts pull-request context cron ; do
|
|
||||||
run actions_verify_example $example
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
23
actions/example-7-0-schedule/.forgejo/workflows/test.yml
Normal file
23
actions/example-7-0-schedule/.forgejo/workflows/test.yml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '* * * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ${{ vars.TEST_SCHEDULE_RUNSON }}
|
||||||
|
container:
|
||||||
|
image: code.forgejo.org/oci/debian:bookworm
|
||||||
|
options: "--volume /srv/example:/srv/example"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
echo "TEST_SCHEDULE_RUNSON=${{ vars.TEST_SCHEDULE_RUNSON }}"
|
||||||
|
touch /srv/example/7-0-schedule-volume/DONE
|
||||||
|
|
||||||
|
- name: save context
|
||||||
|
run: |
|
||||||
|
d=/srv/example/7-0-schedule/contexts/$GITHUB_EVENT_NAME
|
||||||
|
mkdir -p $d
|
||||||
|
cat > $d/github <<'EOF'
|
||||||
|
${{ toJSON(github) }}
|
||||||
|
EOF
|
30
actions/example-7-0-schedule/run.sh
Executable file
30
actions/example-7-0-schedule/run.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token
|
||||||
|
|
||||||
|
forgejo-curl.sh web -X POST http://${HOST_PORT}/admin/actions/variables/1/delete || true
|
||||||
|
forgejo-curl.sh web --form name=TEST_SCHEDULE_RUNSON --form data=docker http://${HOST_PORT}/admin/actions/variables/new
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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-7-0-schedule/branches
|
||||||
|
verify_ref
|
||||||
|
|
||||||
|
# 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/7-0-schedule-volume/DONE ; then
|
||||||
|
cat $FORGEJO_RUNNER_LOGS
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
|
||||||
|
c=/srv/example/7-0-schedule/contexts/schedule/github
|
||||||
|
cat $c
|
||||||
|
test "schedule" = "$(jq -r .event_name < $c)"
|
||||||
|
test "schedule" = "$(jq -r .event.action < $c)"
|
1
actions/example-7-0-schedule/setup.sh
Executable file
1
actions/example-7-0-schedule/setup.sh
Executable file
|
@ -0,0 +1 @@
|
||||||
|
mkdir -p /srv/example/7-0-schedule-volume
|
|
@ -1 +1 @@
|
||||||
https://codeberg.org/forgejo/forgejo forgejo 8.0.0+gitea-1.22.0
|
https://codeberg.org/thefox/forgejo cron-var-context-fix 8.0.0-dev-162-72993c527e+gitea-1.22.0
|
||||||
|
|
1
last-upgrade
Normal file
1
last-upgrade
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Sat Apr 6 14:54:39 UTC 2024
|
Loading…
Reference in a new issue