setup-forgejo/.forgejo/workflows/integration.yml

69 lines
2.9 KiB
YAML
Raw Normal View History

2023-04-01 08:52:42 -04:00
on: [ push, pull_request ]
2023-07-08 08:06:13 -04:00
2023-03-24 10:59:04 -04:00
jobs:
integration:
runs-on: self-hosted
2023-09-24 14:32:40 -04:00
strategy:
matrix:
info:
2023-10-04 09:42:53 -04:00
- version: "1.21.0-2-rc0"
2023-09-24 14:32:40 -04:00
image: codeberg.org/forgejo-experimental/forgejo
tests: "service"
2023-10-04 09:42:53 -04:00
- version: "1.21.0-2-rc0"
image: codeberg.org/forgejo-experimental/forgejo
tests: "artifacts"
2023-10-04 09:42:53 -04:00
- version: "1.21.0-2-rc0"
image: codeberg.org/forgejo-experimental/forgejo
tests: "cron"
2023-10-04 09:42:53 -04:00
- version: "1.21.0-2-rc0"
image: codeberg.org/forgejo-experimental/forgejo
2023-10-04 09:31:52 -04:00
tests: "${{ vars.V121_TESTS || 'echo checkout pull-request container expression local-action docker-action if if-fail' }}"
2023-09-24 14:32:40 -04:00
- version: "1.20"
image: codeberg.org/forgejo/forgejo
2023-10-04 09:31:52 -04:00
tests: "${{ vars.V120_TESTS || 'echo checkout service container expression local-action docker-action if if-fail' }}"
2023-03-24 10:59:04 -04:00
steps:
2023-03-24 17:42:52 -04:00
- uses: actions/checkout@v3
2023-09-29 14:19:00 -04:00
- if: matrix.info.tests != 'none'
run: |
2023-03-24 10:59:04 -04:00
set -x
LXC_IP_PREFIX=10.0.10 ./forgejo-dependencies.sh
2023-09-24 10:54:52 -04:00
export PATH=$(pwd):$PATH
2023-09-24 14:32:40 -04:00
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
#
2023-09-24 14:32:40 -04:00
forgejo-runner.sh setup
export FORGEJO_RUNNER_LOGS=forgejo-runner.log
2023-09-24 14:32:40 -04:00
for example in ${{ matrix.info.tests }} ; do
2023-09-26 15:53:30 -04:00
export example
2023-09-24 14:32:40 -04:00
export EXAMPLE_DIR=$(pwd)/testdata/example-$example
2023-09-24 14:32:40 -04:00
if test -f $EXAMPLE_DIR/setup.sh ; then
2023-09-26 15:53:30 -04:00
$EXAMPLE_DIR/setup.sh
2023-07-08 08:06:13 -04:00
fi
2023-07-08 08:06:13 -04:00
echo "============================ BEGIN example-$example ==================="
2023-09-24 14:32:40 -04:00
if test -f $EXAMPLE_DIR/run.sh ; then
2023-09-26 15:53:30 -04:00
$EXAMPLE_DIR/run.sh
else
2023-09-24 14:32:40 -04:00
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
2023-07-08 08:06:13 -04:00
echo "============================ END example-$example ==================="
2023-09-24 14:32:40 -04:00
if test -f $EXAMPLE_DIR/teardown.sh ; then
2023-09-26 15:53:30 -04:00
$EXAMPLE_DIR/teardown.sh
2023-07-08 08:06:13 -04:00
fi
2023-05-29 09:26:29 -04:00
done
echo "============================ demo ==================="
2023-03-30 10:11:04 -04:00
./forgejo-test-helper.sh run_workflow testdata/demo http://root:admin1234@$(cat forgejo-ip):3000 root demo setup-forgejo $(cat forgejo-token) > /tmp/output
2023-03-29 17:33:49 -04:00
grep '^sha=' /tmp/output