From 9cde43f8ffe738fea20d0deeba0c923287ba6e8e Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 1 Jul 2023 23:21:05 +0200 Subject: [PATCH 1/6] download Go 1.20.5 not 1.20.4 --- forgejo-test-helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 5aa3bfc453931d6dc73bc5ed8d02f9b28a89aad4 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 1 Jul 2023 23:39:03 +0200 Subject: [PATCH 2/6] show the full output when the version does not match --- testdata/sanity-checks/.forgejo/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 }} From a628e8aeee611345dd289f2f1588d9b08af4add0 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 2 Jul 2023 00:37:53 +0200 Subject: [PATCH 3/6] add runner-file to the outputs --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 84ab529..de0a16d 100644 --- a/action.yml +++ b/action.yml @@ -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" From fa0a2eedf33b72479bd3d2e96ad775bd6c0782f0 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 2 Jul 2023 12:14:14 +0200 Subject: [PATCH 4/6] be verbose in debug mode --- runner-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 45ca5972d0846d3ba9e9f8bfb9382d7d4a09cb79 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 2 Jul 2023 12:13:54 +0200 Subject: [PATCH 5/6] upgrade runner to v2.1.0 by default --- README.md | 2 +- action.yml | 2 +- forgejo-runner.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 658c93d..e2694d9 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,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 | diff --git a/action.yml b/action.yml index de0a16d..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' 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 From b4df9b6a675bbe7b70cd42bdccf1a9d32e6093a1 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 3 Jul 2023 23:28:39 +0200 Subject: [PATCH 6/6] update the readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index e2694d9..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 @@ -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