From 4fcf694434ed83e6f28f5735e502acff5bdd2b84 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 12 Jul 2023 12:52:29 +0200 Subject: [PATCH] add the docker-action example & test Refs: https://code.forgejo.org/forgejo/runner/issues/49 --- .forgejo/workflows/integration-nested.yml | 2 +- .forgejo/workflows/integration.yml | 10 +++++++++- .../.forgejo/workflows/test.yml | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 testdata/example-docker-action/.forgejo/workflows/test.yml diff --git a/.forgejo/workflows/integration-nested.yml b/.forgejo/workflows/integration-nested.yml index 4710f50..b03563d 100644 --- a/.forgejo/workflows/integration-nested.yml +++ b/.forgejo/workflows/integration-nested.yml @@ -1,6 +1,6 @@ on: [ push, pull_request ] jobs: - integration: + integration-nested: runs-on: self-hosted steps: - uses: actions/checkout@v3 diff --git a/.forgejo/workflows/integration.yml b/.forgejo/workflows/integration.yml index d10c0ba..bfd4bc5 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -7,7 +7,7 @@ env: # Forgejo instance. The test will be a success once the status of # the commit is success, as set by the Forgejo Action run. # - TESTS: 'echo service container expression local-action' + TESTS: 'echo service container expression local-action docker-action' jobs: integration: @@ -18,6 +18,14 @@ jobs: set -x LXC_IP_PREFIX=10.0.10 ./forgejo-dependencies.sh ./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo 1.19 + # + # 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 $TESTS ; do diff --git a/testdata/example-docker-action/.forgejo/workflows/test.yml b/testdata/example-docker-action/.forgejo/workflows/test.yml new file mode 100644 index 0000000..988a81e --- /dev/null +++ b/testdata/example-docker-action/.forgejo/workflows/test.yml @@ -0,0 +1,19 @@ +on: [push] + +jobs: + ls: + runs-on: docker + steps: + # + # This Docker action creates the file SOMEFILE ... + # + - uses: https://code.forgejo.org/forgejo/test-setup-forgejo-docker@main + with: + args: ${{ github.workspace }}/SOMEFILE + # + # ... which then also exists in the job workspace + # because both docker containers are automatically + # sharing the volume that contains it. + # + - run: | + test -f ${{ github.workspace }}/SOMEFILE