mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-24 01:20:56 -05:00
68 lines
2.9 KiB
YAML
68 lines
2.9 KiB
YAML
on: [ push, pull_request ]
|
|
|
|
jobs:
|
|
integration:
|
|
runs-on: self-hosted
|
|
strategy:
|
|
matrix:
|
|
info:
|
|
- version: "1.21.0-1-rc0"
|
|
image: codeberg.org/forgejo-experimental/forgejo
|
|
tests: "service"
|
|
- version: "1.21.0-1-rc0"
|
|
image: codeberg.org/forgejo-experimental/forgejo
|
|
tests: "artifacts"
|
|
- version: "1.21.0-1-rc0"
|
|
image: codeberg.org/forgejo-experimental/forgejo
|
|
tests: "cron"
|
|
- version: "1.21.0-1-rc0"
|
|
image: codeberg.org/forgejo-experimental/forgejo
|
|
tests: "${{ vars.V121_TESTS || 'echo pull-request container expression local-action docker-action if if-fail' }}"
|
|
- version: "1.20"
|
|
image: codeberg.org/forgejo/forgejo
|
|
tests: "${{ vars.V120_TESTS || 'echo service container expression local-action docker-action if if-fail' }}"
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- if: matrix.info.tests != 'none'
|
|
run: |
|
|
set -x
|
|
LXC_IP_PREFIX=10.0.10 ./forgejo-dependencies.sh
|
|
export PATH=$(pwd):$PATH
|
|
forgejo.sh setup root admin1234 ${{ matrix.info.image }} ${{ matrix.info.version }}
|
|
#
|
|
# Uncomment the following for a shortcut to debugging the Forgejo runner.
|
|
# It will build the runner from a designated repository and branch instead of
|
|
# downloading it from a canonical release.
|
|
#
|
|
#./forgejo-test-helper.sh build_runner http://code.forgejo.org/earl-warren/runner wip-sync
|
|
#export PATH=$(pwd)/forgejo-runner:$PATH
|
|
#
|
|
forgejo-runner.sh setup
|
|
export FORGEJO_RUNNER_LOGS=forgejo-runner.log
|
|
|
|
for example in ${{ matrix.info.tests }} ; do
|
|
export example
|
|
export EXAMPLE_DIR=$(pwd)/testdata/example-$example
|
|
|
|
if test -f $EXAMPLE_DIR/setup.sh ; then
|
|
$EXAMPLE_DIR/setup.sh
|
|
fi
|
|
|
|
echo "============================ BEGIN example-$example ==================="
|
|
if test -f $EXAMPLE_DIR/run.sh ; then
|
|
$EXAMPLE_DIR/run.sh
|
|
else
|
|
if ! forgejo-test-helper.sh run_workflow testdata/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token) >& /tmp/run.out ; then
|
|
cat /tmp/run.out
|
|
false
|
|
fi
|
|
fi
|
|
echo "============================ END example-$example ==================="
|
|
|
|
if test -f $EXAMPLE_DIR/teardown.sh ; then
|
|
$EXAMPLE_DIR/teardown.sh
|
|
fi
|
|
done
|
|
echo "============================ demo ==================="
|
|
./forgejo-test-helper.sh run_workflow testdata/demo http://root:admin1234@$(cat forgejo-ip):3000 root demo setup-forgejo $(cat forgejo-token) > /tmp/output
|
|
grep '^sha=' /tmp/output
|