From 7f23c0bd5ff9a21fcb25ba9becc99c4cbebfee93 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 4 Oct 2023 15:18:17 +0200 Subject: [PATCH 1/5] upgrade go v1.21.1 --- forgejo-test-helper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forgejo-test-helper.sh b/forgejo-test-helper.sh index 64e160a..01dae72 100755 --- a/forgejo-test-helper.sh +++ b/forgejo-test-helper.sh @@ -12,14 +12,14 @@ DIR=$(mktemp -d) trap "rm -fr $DIR" EXIT function dependency_go() { - go_version="1.21.0.linux-amd64" # Set the desired Go version here + go_version="1.21.1.linux-amd64" # Set the desired Go version here if ! which go > /dev/null ; then apt-get update apt-get install -y -qq wget tar wget --quiet "https://go.dev/dl/go$go_version.tar.gz" tar zxf "go$go_version.tar.gz" - export PATH="$PATH:$(pwd)/go/bin" + export PATH="$(pwd)/go/bin:$PATH" fi } From 5cf6f35778dacbdc2081c601f491a8f505bb6b06 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 4 Oct 2023 15:31:52 +0200 Subject: [PATCH 2/5] add tests for actions/checkout --- .forgejo/workflows/integration.yml | 4 ++-- testdata/example-checkout/.forgejo/workflows/v3.yml | 8 ++++++++ testdata/example-checkout/.forgejo/workflows/v4.yml | 8 ++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 testdata/example-checkout/.forgejo/workflows/v3.yml create mode 100644 testdata/example-checkout/.forgejo/workflows/v4.yml diff --git a/.forgejo/workflows/integration.yml b/.forgejo/workflows/integration.yml index 7208ff0..11ac19e 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -17,10 +17,10 @@ jobs: tests: "cron" - version: "1.21.0-1-rc0" image: codeberg.org/forgejo-experimental/forgejo - tests: "${{ vars.V121_TESTS || 'echo pull-request container expression local-action docker-action if if-fail' }}" + tests: "${{ vars.V121_TESTS || 'echo checkout pull-request container expression local-action docker-action if if-fail' }}" - version: "1.20" image: codeberg.org/forgejo/forgejo - tests: "${{ vars.V120_TESTS || 'echo service container expression local-action docker-action if if-fail' }}" + tests: "${{ vars.V120_TESTS || 'echo checkout service container expression local-action docker-action if if-fail' }}" steps: - uses: actions/checkout@v3 - if: matrix.info.tests != 'none' diff --git a/testdata/example-checkout/.forgejo/workflows/v3.yml b/testdata/example-checkout/.forgejo/workflows/v3.yml new file mode 100644 index 0000000..33533a6 --- /dev/null +++ b/testdata/example-checkout/.forgejo/workflows/v3.yml @@ -0,0 +1,8 @@ +on: [push] +jobs: + ls: + runs-on: docker + steps: + - uses: actions/checkout@v3 + - run: | + ls ${{ github.workspace }} diff --git a/testdata/example-checkout/.forgejo/workflows/v4.yml b/testdata/example-checkout/.forgejo/workflows/v4.yml new file mode 100644 index 0000000..34c9b57 --- /dev/null +++ b/testdata/example-checkout/.forgejo/workflows/v4.yml @@ -0,0 +1,8 @@ +on: [push] +jobs: + ls: + runs-on: docker + steps: + - uses: actions/checkout@v4 + - run: | + ls ${{ github.workspace }} From 2657043de5abd65442bf14fe6b7ce27fe3eb0dba Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 4 Oct 2023 15:42:53 +0200 Subject: [PATCH 3/5] upgrade tests to v1.21.0-2-rc0 --- .forgejo/workflows/forgejo-sh.yml | 2 +- .forgejo/workflows/integration.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/forgejo-sh.yml b/.forgejo/workflows/forgejo-sh.yml index f11796c..edc7d47 100644 --- a/.forgejo/workflows/forgejo-sh.yml +++ b/.forgejo/workflows/forgejo-sh.yml @@ -20,7 +20,7 @@ jobs: ( echo codeberg.org/forgejo/forgejo 1.19.4-0 echo codeberg.org/forgejo/forgejo 1.20.4-1 - echo codeberg.org/forgejo-experimental/forgejo 1.21.0-0-rc0 + echo codeberg.org/forgejo-experimental/forgejo 1.21.0-2-rc0 ) | while read url version ; do echo "=========================== launching forgejo v$version ==========" forgejo.sh setup root admin1234 $url $version diff --git a/.forgejo/workflows/integration.yml b/.forgejo/workflows/integration.yml index 11ac19e..620c73f 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -6,16 +6,16 @@ jobs: strategy: matrix: info: - - version: "1.21.0-1-rc0" + - version: "1.21.0-2-rc0" image: codeberg.org/forgejo-experimental/forgejo tests: "service" - - version: "1.21.0-1-rc0" + - version: "1.21.0-2-rc0" image: codeberg.org/forgejo-experimental/forgejo tests: "artifacts" - - version: "1.21.0-1-rc0" + - version: "1.21.0-2-rc0" image: codeberg.org/forgejo-experimental/forgejo tests: "cron" - - version: "1.21.0-1-rc0" + - version: "1.21.0-2-rc0" image: codeberg.org/forgejo-experimental/forgejo tests: "${{ vars.V121_TESTS || 'echo checkout pull-request container expression local-action docker-action if if-fail' }}" - version: "1.20" From 96cc7b49911562997bdff83df9fc8c2cc64b12d0 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 4 Oct 2023 16:54:14 +0200 Subject: [PATCH 4/5] default runner is v3.0.1 --- README.md | 4 ++-- action.yml | 4 ++-- forgejo-runner.sh | 2 +- testdata/example-if-cancel/.forgejo/workflows/test.yml | 2 +- testdata/example-if-fail/.forgejo/workflows/test.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2da9cb1..2b18601 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The forgejo-test-helper.sh script is available to help test and debug actions. Creates the repository `$forgejo/root/testrepo` and populates it with the content of the `testrepo` directory. The SHA of the tip of the repository is in the output, on a line starting with `sha=`. -* `forgejo-test-helper.sh build_runner $forgejo/forgejo/runner v3.0.0` +* `forgejo-test-helper.sh build_runner $forgejo/forgejo/runner v3.0.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. @@ -48,7 +48,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.5.0 | +| runner-version | Runner version | `false` | v3.0.1 | | 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 95840df..086d9e9 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ description: | Creates the repository `$forgejo/root/testrepo` and populates it with the content of the `testrepo` directory. The SHA of the tip of the repository is in the output, on a line starting with `sha=`. - * `forgejo-test-helper.sh build_runner $forgejo/forgejo/runner v3.0.0` + * `forgejo-test-helper.sh build_runner $forgejo/forgejo/runner v3.0.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. @@ -52,7 +52,7 @@ inputs: default: 'https://code.forgejo.org/forgejo/runner' runner-version: description: 'Runner version' - default: 'v2.5.0' + default: 'v3.0.1' container: description: 'Name of the container running the Forgejo instance' default: 'forgejo' diff --git a/forgejo-runner.sh b/forgejo-runner.sh index dd9de5d..4c955b6 100755 --- a/forgejo-runner.sh +++ b/forgejo-runner.sh @@ -41,7 +41,7 @@ function reload() { function setup() { local runner_repository="${1:-https://code.forgejo.org/forgejo/runner}" - local version="${2:-v2.5.0}" + local version="${2:-v3.0.1}" local forgejo="${3:-http://$(cat forgejo-ip):3000/}" dependencies diff --git a/testdata/example-if-cancel/.forgejo/workflows/test.yml b/testdata/example-if-cancel/.forgejo/workflows/test.yml index 6ae5dbd..5a92198 100644 --- a/testdata/example-if-cancel/.forgejo/workflows/test.yml +++ b/testdata/example-if-cancel/.forgejo/workflows/test.yml @@ -2,7 +2,7 @@ # As of Forgejo v1.20 running this example would require using the web # endpoints because there is no API to do the same. # -# It was manually tested to **not work** with Forgejo v1.20 & runner 2.5.0 +# It was manually tested to **not work** with Forgejo v1.21 & runner 3.0.1 # on: [push] diff --git a/testdata/example-if-fail/.forgejo/workflows/test.yml b/testdata/example-if-fail/.forgejo/workflows/test.yml index 4c0e5af..7720b00 100644 --- a/testdata/example-if-fail/.forgejo/workflows/test.yml +++ b/testdata/example-if-fail/.forgejo/workflows/test.yml @@ -13,7 +13,7 @@ jobs: # # This is documented in GitHub Actions and does not work in Forgejo Actions - # as of 3.0.0. + # as of 3.0.1. # # If you have a chain of dependent jobs, failure() returns true if any ancestor job fails. # From 78e5741fbab8a7f7f9c54b0d78a456bb80560fcc Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 4 Oct 2023 17:01:08 +0200 Subject: [PATCH 5/5] v3.0.0 and above have a different naming scheme --- forgejo-runner.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/forgejo-runner.sh b/forgejo-runner.sh index 4c955b6..bc3d165 100755 --- a/forgejo-runner.sh +++ b/forgejo-runner.sh @@ -16,7 +16,10 @@ function download() { local version="$2" if ! which forgejo-runner > /dev/null; then - curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-amd64 > /bin/forgejo-runner + if ! curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-${version#v}-linux-amd64 > /bin/forgejo-runner ; then + # backward compatibility for for the naming scheme prior to 3.0.0 + curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-linux-amd64 > /bin/forgejo-runner + fi chmod 755 /bin/forgejo-runner fi }