mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-27 08:40:57 -05:00
Merge pull request 'upgrade runner 3.0.1' (#53) from earl-warren/setup-forgejo:wip-test-runner-act into main
Reviewed-on: https://code.forgejo.org/actions/setup-forgejo/pulls/53 Reviewed-by: dachary <dachary@noreply.code.forgejo.org>
This commit is contained in:
commit
3117f64380
10 changed files with 36 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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 |
|
||||
<!-- action-docs-inputs -->
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
8
testdata/example-checkout/.forgejo/workflows/v3.yml
vendored
Normal file
8
testdata/example-checkout/.forgejo/workflows/v3.yml
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
ls:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: |
|
||||
ls ${{ github.workspace }}
|
8
testdata/example-checkout/.forgejo/workflows/v4.yml
vendored
Normal file
8
testdata/example-checkout/.forgejo/workflows/v4.yml
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
ls:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: |
|
||||
ls ${{ github.workspace }}
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue