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

68 lines
2.7 KiB
YAML
Raw Normal View History

2023-04-01 12:52:42 +00:00
on: [ push, pull_request ]
2023-07-08 12:06:13 +00:00
env:
#
# List of tests to run as found in testdata/example-$test. The
# directory will be used to create a git repository uploaded to a
# Forgejo instance.
#
# The test will be a success once the status of
2023-07-08 12:06:13 +00:00
# the commit is success, as set by the Forgejo Action run.
#
TESTS: 'echo service container expression local-action docker-action if'
#
# The test is expected to fail the workflow and verify the expected
# side effect of the failure with testdata/example-$test/expected-to-fail.sh
#
TESTS_FAILING: 'if-fail'
2023-07-08 12:06:13 +00:00
2023-03-24 14:59:04 +00:00
jobs:
integration:
runs-on: self-hosted
steps:
2023-03-24 21:42:52 +00:00
- uses: actions/checkout@v3
2023-03-24 14:59:04 +00:00
- run: |
set -x
LXC_IP_PREFIX=10.0.10 ./forgejo-dependencies.sh
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo 1.20
#
# 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-03-24 21:42:52 +00:00
./forgejo-runner.sh setup
export FORGEJO_RUNNER_LOGS=forgejo-runner.log
for example in $TESTS $TESTS_FAILING ; do
if test $example = service ; then
> /srv/example-service-volume-valid
> /srv/example-service-volume-invalid
fi
2023-07-08 12:06:13 +00:00
config=$(pwd)/testdata/example-$example/runner-config.yaml
if test -f $config ; then
FORGEJO_RUNNER_CONFIG=$config ./forgejo-runner.sh reload
fi
2023-07-08 12:06:13 +00:00
echo "============================ BEGIN example-$example ==================="
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
! test -f testdata/example-$example/expected-to-fail.sh
else
cat /tmp/run.out
test -f testdata/example-$example/expected-to-fail.sh
fi
2023-07-08 12:06:13 +00:00
echo "============================ END example-$example ==================="
2023-07-08 12:06:13 +00:00
if test -f $config ; then
./forgejo-runner.sh reload
fi
2023-05-29 13:26:29 +00:00
done
echo "============================ demo ==================="
2023-03-30 14:11:04 +00: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 21:33:49 +00:00
grep '^sha=' /tmp/output