1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-forgejo synced 2024-09-19 18:06:17 +00:00
setup-forgejo/.forgejo/workflows/integration.yml

71 lines
2.9 KiB
YAML
Raw Normal View History

on:
push:
branches:
- 'main'
- 'v*'
pull_request_target:
2023-07-08 12:06:13 +00:00
2023-03-24 14:59:04 +00:00
jobs:
integration:
runs-on: self-hosted
2023-09-24 18:32:40 +00:00
strategy:
matrix:
info:
2023-10-11 16:31:18 +00:00
- version: "1.21.0-3-rc0"
2023-09-24 18:32:40 +00:00
image: codeberg.org/forgejo-experimental/forgejo
2023-10-04 15:57:11 +00:00
# keep "cron" last otherwise it will linger and pollute the following runs
tests: "${{ vars.V1_21_TESTS || 'echo push-cancel artifacts service checkout pull-request container expression local-action docker-action if if-fail cron' }}"
2023-09-24 18:32:40 +00:00
- version: "1.20"
image: codeberg.org/forgejo/forgejo
tests: "${{ vars.V1_20_TESTS || 'echo checkout service container expression local-action docker-action if if-fail' }}"
2023-03-24 14:59:04 +00:00
steps:
2023-03-24 21:42:52 +00:00
- uses: actions/checkout@v3
2023-09-29 18:19:00 +00:00
- if: matrix.info.tests != 'none'
2023-10-04 16:11:42 +00:00
shell: bash
2023-09-29 18:19:00 +00:00
run: |
LXC_IP_PREFIX=10.0.10 ./forgejo-dependencies.sh
2023-09-24 14:54:52 +00:00
export PATH=$(pwd):$PATH
2023-09-24 18:32:40 +00:00
forgejo.sh setup root admin1234 ${{ matrix.info.image }} ${{ matrix.info.version }}
forgejo-runner.sh setup
export FORGEJO_RUNNER_LOGS=forgejo-runner.log
url=http://root:admin1234@$(cat forgejo-ip):3000
token=$(cat forgejo-token)
2023-10-04 16:11:42 +00:00
echo "============================ demo ==================="
forgejo-test-helper.sh run_workflow testdata/demo $url root demo setup-forgejo $token
2023-10-04 16:11:42 +00:00
function run() {
local example=$1
2023-09-26 19:53:30 +00:00
export example
2023-09-24 18:32:40 +00:00
export EXAMPLE_DIR=$(pwd)/testdata/example-$example
2023-09-24 18:32:40 +00:00
if test -f $EXAMPLE_DIR/setup.sh ; then
2023-10-04 16:11:42 +00:00
echo "============================ SETUP example-$example ==================="
bash -ex $EXAMPLE_DIR/setup.sh || return 1
2023-07-08 12:06:13 +00:00
fi
2023-09-24 18:32:40 +00:00
if test -f $EXAMPLE_DIR/run.sh ; then
2023-10-04 16:11:42 +00:00
echo "============================ RUN example-$example ==================="
bash -ex $EXAMPLE_DIR/run.sh || return 1
else
forgejo-test-helper.sh run_workflow testdata/example-$example $url root example-$example setup-forgejo $token || return 1
fi
2023-09-24 18:32:40 +00:00
if test -f $EXAMPLE_DIR/teardown.sh ; then
2023-10-04 16:11:42 +00:00
echo "============================ TEARDOWN example-$example ==================="
bash -ex $EXAMPLE_DIR/teardown.sh || return 1
2023-07-08 12:06:13 +00:00
fi
2023-10-04 16:11:42 +00:00
}
for example in ${{ matrix.info.tests }} ; do
echo "============================ BEGIN example-$example ==================="
if ! time run $example >& /tmp/run.out ; then
cat /tmp/run.out
echo "============================ FAIL example-$example ==================="
sleep 5 # hack for Forgejo v1.21 to workaround a but by which the last lines of the output are moved to the next step
false
fi
echo "============================ END example-$example ==================="
2023-05-29 13:26:29 +00:00
done