133 lines
4.3 KiB
YAML
133 lines
4.3 KiB
YAML
#
|
|
#
|
|
# https://code.forgejo.org/forgejo/end-to-end/settings/actions
|
|
#
|
|
# secrets.CASCADE_DOCS_ORIGIN_TOKEN
|
|
# https://code.forgejo.org/forgejo-ci scope write:issue, read:repository, read:user
|
|
# vars.CASCADE_DOCS_DESTINATION_DOER
|
|
# forgejo-cascading-pr (https://codeberg.org/forgejo-cascading-pr)
|
|
# secrets.CASCADE_DOCS_DESTINATION_TOKEN
|
|
# https://codeberg.org/forgejo-cascading-pr scope write:issue, write:repository, read:user
|
|
# vars.CASCADE_DOCS_FORCE_VERSION
|
|
# replace the generated documentation for a given version even if it has already
|
|
# been generated (e.g. v7.0.0-test)
|
|
#
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
container:
|
|
image: 'docker.io/node:20-bookworm'
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
|
- uses: https://code.forgejo.org/actions/setup-go@v4
|
|
with:
|
|
go-version: "1.22"
|
|
- name: lib/build.sh
|
|
run: |
|
|
set -x
|
|
|
|
#
|
|
# SQLite needs gcc to be compiled
|
|
#
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
apt-get update -qq
|
|
apt-get -q install -y -qq build-essential
|
|
|
|
d=/tmp/forgejo-binaries
|
|
mkdir $d /tmp/forgejo-upload
|
|
|
|
for version in $(ls forgejo/sources) ; do
|
|
forgejo=$d/forgejo-$version-dev
|
|
lib/build.sh $version $d
|
|
$forgejo --version
|
|
mv $forgejo /tmp/forgejo-upload
|
|
done
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: forgejo-dev
|
|
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:
|
|
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_actions"
|
|
- name: full logs
|
|
if: always()
|
|
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"
|