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 7208ff0..620c73f 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -6,21 +6,21 @@ 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 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/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..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 } @@ -41,7 +44,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/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 } 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 }} 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. #