diff --git a/README.md b/README.md index 658c93d..ed5c26e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,11 @@ The forgejo-test-helper.sh script is available to help test and debug actions. Create the repository `$forgejo/root/testrepo` and populate it with the content of the `testrepo` directory. The SHA of the tip of the repository is in the output, starting with `sha=`. +* `forgejo-test-helper.sh build_runner $forgejo/forgejo/runner v1.4.1` + Builds the forgejo runner from source in `./forgejo-runner/forgejo-runner`. + `export PATH=$(pwd)/forgejo-runner:$PATH` will ensure that calling `forgejo-runner.sh` + will use this binary instead of downloading a released version of the runner. + If the version is not specified, build from the main branch. The combination of `push_self_action` and `run_workflow` allows to run Forgejo Actions workflows from `testrepo` that use the action @@ -40,7 +45,7 @@ It can only be run on the `self-hosted` platform, running on a host with LXC ins | user | Administrator user name | `false` | root | | password | Administrator password | `false` | admin1234 | | runner | Runner git repository | `false` | https://code.forgejo.org/forgejo/runner | -| runner-version | Runner version | `false` | v2.0.0 | +| runner-version | Runner version | `false` | v2.1.0 | | container | Name of the container running the Forgejo instance | `false` | forgejo | | lxc-ip-prefix | Class C IP prefix used by LXC | `false` | 10.0.23 | @@ -55,6 +60,7 @@ It can only be run on the `self-hosted` platform, running on a host with LXC ins | host-port | Host and port of the Forgejo instance, e.g 172.0.17.2:3000 | | token | Administrator application token with all,sudo scopes | | runner-logs | Filename of the Forgejo runner logs | +| runner-file | Path to the runner file | ## Example diff --git a/action.yml b/action.yml index 84ab529..ec59a35 100644 --- a/action.yml +++ b/action.yml @@ -49,7 +49,7 @@ inputs: default: 'https://code.forgejo.org/forgejo/runner' runner-version: description: 'Runner version' - default: 'v2.0.0' + default: 'v2.1.0' container: description: 'Name of the container running the Forgejo instance' default: 'forgejo' @@ -69,6 +69,9 @@ outputs: runner-logs: description: "Filename of the Forgejo runner logs" value: "${{ steps.forgejo.outputs.runner-logs }}" + runner-file: + description: "Path to the runner file" + value: "${{ steps.forgejo.outputs.runner-file }}" runs: using: "composite" diff --git a/forgejo-runner.sh b/forgejo-runner.sh index 292aa9f..535e591 100755 --- a/forgejo-runner.sh +++ b/forgejo-runner.sh @@ -36,7 +36,7 @@ function run() { function setup() { local runner_repository="${1:-https://code.forgejo.org/forgejo/runner}" - local version="${2:-v2.0.0}" + local version="${2:-v2.1.0}" local forgejo="${3:-http://$(cat forgejo-ip):3000/}" dependencies diff --git a/forgejo-test-helper.sh b/forgejo-test-helper.sh index a41e994..54fa822 100755 --- a/forgejo-test-helper.sh +++ b/forgejo-test-helper.sh @@ -13,7 +13,7 @@ function dependency_go() { if ! which go > /dev/null ; then apt-get update apt-get install -y -qq wget tar - wget --quiet https://go.dev/dl/go1.20.4.linux-amd64.tar.gz + wget --quiet https://go.dev/dl/go1.20.5.linux-amd64.tar.gz tar zxf go1.20.5.linux-amd64.tar.gz export PATH=$PATH:$(pwd)/go/bin fi diff --git a/runner-config.yaml b/runner-config.yaml index 177f002..86b1aff 100644 --- a/runner-config.yaml +++ b/runner-config.yaml @@ -2,7 +2,7 @@ log: # The level of logging, can be trace, debug, info, warn, error, fatal - level: info + level: debug runner: # Where to store the registration result. diff --git a/testdata/sanity-checks/.forgejo/workflows/test.yml b/testdata/sanity-checks/.forgejo/workflows/test.yml index 58a1608..bf72ef0 100644 --- a/testdata/sanity-checks/.forgejo/workflows/test.yml +++ b/testdata/sanity-checks/.forgejo/workflows/test.yml @@ -20,5 +20,9 @@ jobs: set -ex test "${{ steps.forgejo.outputs.token }}" test "FORGEJO_TOKEN" -a "FORGEJO_TOKEN" != F'O'RGEJO_TOKEN - curl ${{ steps.forgejo.outputs.url }}/api/forgejo/v1/version | grep 1.19 + curl ${{ steps.forgejo.outputs.url }}/api/forgejo/v1/version >& version.out + if ! grep --quiet 1.19 version.out ; then + cat version.out + exit 1 + fi test -f ${{ steps.forgejo.outputs.runner-file }}