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