Compare commits

...

13 commits

Author SHA1 Message Date
d97839cd90
fix(workflow): point to correct repo
Some checks failed
cascade / debug (push) Failing after 0s
cascade / forgejo (push) Failing after 0s
checks / build and test (push) Failing after 1s
checks / validate mocks (push) Failing after 0s
checks / validate pre-commit-hooks file (push) Failing after 0s
ci / goreleaser (push) Successful in 5m40s
checks / runner integration tests (push) Has been cancelled
example / docker-build-push-action-in-lxc (push) Has been cancelled
/ example-docker-compose (push) Has been cancelled
/ example-lxc-systemd (push) Has been cancelled
checks / integration tests (push) Has been cancelled
checks / runner exec tests (push) Has been cancelled
Build release / release (push) Has been cancelled
publish / publish (push) Has been cancelled
2025-10-30 09:09:10 +00:00
1f8217d99b
fix(workflow): remove go generate from goreleaser
Some checks failed
example / docker-build-push-action-in-lxc (push) Waiting to run
/ example-docker-compose (push) Waiting to run
/ example-lxc-systemd (push) Waiting to run
cascade / forgejo (push) Failing after 0s
checks / build and test (push) Failing after 0s
cascade / debug (push) Failing after 0s
checks / validate mocks (push) Failing after 0s
checks / validate pre-commit-hooks file (push) Failing after 0s
ci / goreleaser (push) Failing after 5m37s
checks / integration tests (push) Has been cancelled
checks / runner exec tests (push) Has been cancelled
checks / runner integration tests (push) Has been cancelled
Build release / release (push) Has been cancelled
publish / publish (push) Has been cancelled
2025-10-30 08:57:37 +00:00
cd83c525c8
chore(workflow): set up simpler build pipeline
Some checks failed
example / docker-build-push-action-in-lxc (push) Waiting to run
/ example-docker-compose (push) Waiting to run
/ example-lxc-systemd (push) Waiting to run
cascade / debug (push) Failing after 0s
cascade / forgejo (push) Failing after 0s
checks / build and test (push) Failing after 0s
checks / validate mocks (push) Failing after 0s
checks / validate pre-commit-hooks file (push) Failing after 0s
ci / goreleaser (push) Failing after 3m59s
checks / integration tests (push) Has been cancelled
checks / runner exec tests (push) Has been cancelled
checks / runner integration tests (push) Has been cancelled
Build release / release (push) Has been cancelled
publish / publish (push) Has been cancelled
2025-10-30 08:48:02 +00:00
88e6654a6c feat(runner): Added waiting for a job arrival in the one-job command. 2025-10-29 11:12:12 +01:00
Renovate Bot
10a9ab9001
Update code.forgejo.org/forgejo/forgejo Docker tag to v11.0.7 (#1113)
Some checks are pending
Build release / release (push) Waiting to run
publish / publish (push) Waiting to run
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [code.forgejo.org/forgejo/forgejo](https://forgejo.org) ([source](https://codeberg.org/forgejo/forgejo)) | patch | `11.0.6` -> `11.0.7` |

---

### Release Notes

<details>
<summary>forgejo/forgejo (code.forgejo.org/forgejo/forgejo)</summary>

### [`v11.0.7`](https://codeberg.org/forgejo/forgejo/releases/tag/v11.0.7)

[Compare Source](https://codeberg.org/forgejo/forgejo/compare/v11.0.6...v11.0.7)

See <https://codeberg.org/forgejo/forgejo/src/branch/forgejo/release-notes-published/11.0.7.md>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTIuOSIsInVwZGF0ZWRJblZlciI6IjQxLjE1Mi45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY3lVcGRhdGUiLCJydW4tZW5kLXRvLWVuZC10ZXN0cyJdfQ==-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1113
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-10-27 07:33:24 +00:00
volkmnv
ea961a70c3
fix: windows compilation (#1101)
Original pull request: https://code.forgejo.org/forgejo/runner/pulls/987
Fixes https://code.forgejo.org/forgejo/runner/issues/1032

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/1101): <!--number 1101 --><!--line 0 --><!--description Zml4OiB3aW5kb3dzIGNvbXBpbGF0aW9u-->fix: windows compilation<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1101
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: volkmnv <volkmnv@noreply.code.forgejo.org>
Co-committed-by: volkmnv <volkmnv@noreply.code.forgejo.org>
2025-10-24 07:00:43 +00:00
Renovate Bot
8a98a8a512
Update data.forgejo.org/oci/golang Docker tag to v1.25 (#1110)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [data.forgejo.org/oci/golang](https://hub.docker.com/_/golang) ([source](https://github.com/docker-library/golang)) | stage | minor | `1.24-alpine3.22` -> `1.25-alpine3.22` |

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTIuOSIsInVwZGF0ZWRJblZlciI6IjQxLjE1Mi45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY3lVcGRhdGUiLCJydW4tZW5kLXRvLWVuZC10ZXN0cyJdfQ==-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1110
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-10-24 06:37:56 +00:00
Earl Warren
2301db6f85
fix: ${{ env.VAR }} is allowed in container (#1108)
Resolves forgejo/forgejo-actions-feature-requests#62

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/1108): <!--number 1108 --><!--line 0 --><!--description Zml4OiAke3sgZW52LlZBUiB9fSBpcyBhbGxvd2VkIGluIGNvbnRhaW5lcg==-->fix: ${{ env.VAR }} is allowed in container<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1108
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-10-22 06:31:45 +00:00
Renovate Bot
aab9e22819 Update dependency forgejo/lxc-helpers to v1.1.3 (#1106)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [forgejo/lxc-helpers](https://code.forgejo.org/forgejo/lxc-helpers) | patch | `1.1.1` -> `1.1.3` |

---

### Release Notes

<details>
<summary>forgejo/lxc-helpers (forgejo/lxc-helpers)</summary>

### [`v1.1.3`](https://code.forgejo.org/forgejo/lxc-helpers/compare/v1.1.2...v1.1.3)

[Compare Source](https://code.forgejo.org/forgejo/lxc-helpers/compare/v1.1.2...v1.1.3)

### [`v1.1.2`](https://code.forgejo.org/forgejo/lxc-helpers/compare/v1.1.1...v1.1.2)

[Compare Source](https://code.forgejo.org/forgejo/lxc-helpers/compare/v1.1.1...v1.1.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTIuOSIsInVwZGF0ZWRJblZlciI6IjQxLjE1Mi45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY3lVcGRhdGUiLCJydW4tZW5kLXRvLWVuZC10ZXN0cyJdfQ==-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1106
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-10-21 03:21:33 +00:00
Earl Warren
403489591e
Revert "chore(cleanup): lxc-helpers does not need a global lock (#1047)" (#1103)
This reverts commit 996ac343ee.

The lock is still needed to guard against the following scenario.

d92a892ece/act/runner/run_context.go (L225-L236)

- two or more jobs start
- one of them creates the act template (`lxc_build_template $(lxc_template_release) $name`) - lxc-helpers now has transactions and they won't race against each other
- once it is built all jobs will then try to install node in the container that was just built and race against each other

with a global lock only the first one will build and populate the act template. The other will then do nothing because it already exists.

The bug can trivially be reproduced with:

```yaml
on:
  pull_request:

jobs:
  test1:
    runs-on: lxc
    steps:
      - run: echo OK1
  test2:
    runs-on: lxc
    steps:
      - run: echo OK2
  test3:
    runs-on: lxc
    steps:
      - run: echo OK3
```

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/1103): <!--number 1103 --><!--line 0 --><!--description UmV2ZXJ0ICJjaG9yZShjbGVhbnVwKTogbHhjLWhlbHBlcnMgZG9lcyBub3QgbmVlZCBhIGdsb2JhbCBsb2NrICgjMTA0Nyki-->Revert "chore(cleanup): lxc-helpers does not need a global lock (#1047)"<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1103
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: limiting-factor <limiting-factor@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-10-20 21:05:05 +00:00
cascading-pr
8034eaaabb
fix: lxc_exists_and_apt_not_old must be in a transaction (#1104)
cascading-pr from https://code.forgejo.org/forgejo/lxc-helpers/pulls/52

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/1104): <!--number 1104 --><!--line 0 --><!--description Zml4OiBseGNfZXhpc3RzX2FuZF9hcHRfbm90X29sZCBtdXN0IGJlIGluIGEgdHJhbnNhY3Rpb24=-->fix: lxc_exists_and_apt_not_old must be in a transaction<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: cascading-pr <cascading-pr@example.com>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1104
Reviewed-by: limiting-factor <limiting-factor@noreply.code.forgejo.org>
Co-authored-by: cascading-pr <cascading-pr@noreply.code.forgejo.org>
Co-committed-by: cascading-pr <cascading-pr@noreply.code.forgejo.org>
2025-10-20 21:03:14 +00:00
Earl Warren
44f4557005
chore(ci): use code.forgejo.org/oci/alpine:latest (#1100)
The current AWS outage revealed one location still using docker.io instead of the code.forgejo.org mirror:

```
2025-10-20T09:22:44.6442259Z [actions-with-environment-and-context-tests/check] [DEBUG] Head "https://registry-1.docker.io/v2/library/alpine/manifests/3": received unexpected HTTP status: 503 Service Unavailable
```

https://code.forgejo.org/forgejo/runner/actions/runs/11442/jobs/2/attempt/3#jobstep-5-56398

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/1100): <!--number 1100 --><!--line 0 --><!--description Y2hvcmUoY2kpOiB1c2UgY29kZS5mb3JnZWpvLm9yZy9vY2kvYWxwaW5lOmxhdGVzdA==-->chore(ci): use code.forgejo.org/oci/alpine:latest<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1100
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-10-20 15:18:52 +00:00
cascading-pr
d92a892ece
fix: enforce LXC bootstrap locks (#1098)
cascading-pr from https://code.forgejo.org/forgejo/lxc-helpers/pulls/51

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/1098): <!--number 1098 --><!--line 0 --><!--description Zml4OiBlbmZvcmNlIExYQyBib290c3RyYXAgbG9ja3M=-->fix: enforce LXC bootstrap locks<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: cascading-pr <cascading-pr@example.com>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1098
Co-authored-by: cascading-pr <cascading-pr@noreply.code.forgejo.org>
Co-committed-by: cascading-pr <cascading-pr@noreply.code.forgejo.org>
2025-10-20 11:55:59 +00:00
16 changed files with 145 additions and 22 deletions

View file

@ -0,0 +1,27 @@
name: ci
on:
push:
tags:
- v*
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ">=1.25.1"
- name: Test code
run: make test
- name: Run GoReleaser
uses: https://github.com/goreleaser/goreleaser-action@v6
env:
GITEA_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
with:
args: release --clean

View file

@ -19,7 +19,7 @@ on:
enable-email-notifications: true enable-email-notifications: true
env: env:
FORGEJO_VERSION: 11.0.6 # renovate: datasource=docker depName=code.forgejo.org/forgejo/forgejo FORGEJO_VERSION: 11.0.7 # renovate: datasource=docker depName=code.forgejo.org/forgejo/forgejo
jobs: jobs:
release-simulation: release-simulation:

View file

@ -21,7 +21,7 @@ on:
enable-email-notifications: true enable-email-notifications: true
env: env:
FORGEJO_VERSION: 11.0.6 # renovate: datasource=docker depName=code.forgejo.org/forgejo/forgejo FORGEJO_VERSION: 11.0.7 # renovate: datasource=docker depName=code.forgejo.org/forgejo/forgejo
FORGEJO_USER: root FORGEJO_USER: root
FORGEJO_PASSWORD: admin1234 FORGEJO_PASSWORD: admin1234

View file

@ -14,7 +14,7 @@ env:
SERIAL: "30" SERIAL: "30"
LIFETIME: "60" LIFETIME: "60"
SYSTEMD_OPTIONS: "--no-pager --full" SYSTEMD_OPTIONS: "--no-pager --full"
USE_VERSION: 11.0.6 # renovate: datasource=docker depName=code.forgejo.org/forgejo/forgejo USE_VERSION: 11.0.7 # renovate: datasource=docker depName=code.forgejo.org/forgejo/forgejo
jobs: jobs:
example-lxc-systemd: example-lxc-systemd:

60
.goreleaser.yaml Normal file
View file

@ -0,0 +1,60 @@
version: 2
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
archives:
- formats: [binary]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
changelog:
abbrev: 10
filters:
exclude:
- "^docs:"
- "^test:"
format: "{{.SHA}}: {{.Message}}"
groups:
- title: Features
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: "Bug fixes"
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 1
- title: "Chores"
regexp: '^.*?chore(\([[:word:]]+\))??!?:.+$'
order: 2
- title: Others
order: 999
sort: asc
release:
gitea:
owner: DevFW-CICD
name: runner
force_token: gitea
gitea_urls:
api: https://edp.buildth.ing/api/v1
download: https://edp.buildth.ing
# set to true if you use a self-signed certificate
skip_tls_verify: false

View file

@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.24-alpine3.22 AS build-env FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.25-alpine3.22 AS build-env
# #
# Transparently cross compile for the target platform # Transparently cross compile for the target platform

View file

@ -9,7 +9,6 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
"syscall"
"time" "time"
"github.com/julienschmidt/httprouter" "github.com/julienschmidt/httprouter"
@ -25,7 +24,7 @@ const (
var fatal = func(logger logrus.FieldLogger, err error) { var fatal = func(logger logrus.FieldLogger, err error) {
logger.Errorf("unrecoverable error in the cache: %v", err) logger.Errorf("unrecoverable error in the cache: %v", err)
if err := syscall.Kill(syscall.Getpid(), syscall.SIGTERM); err != nil { if err := suicide(); err != nil {
logger.Errorf("unrecoverable error in the cache: failed to send the TERM signal to shutdown the daemon %v", err) logger.Errorf("unrecoverable error in the cache: failed to send the TERM signal to shutdown the daemon %v", err)
} }
} }

View file

@ -0,0 +1,9 @@
//go:build !windows
package artifactcache
import "syscall"
func suicide() error {
return syscall.Kill(syscall.Getpid(), syscall.SIGTERM)
}

View file

@ -0,0 +1,14 @@
//go:build windows
package artifactcache
import "syscall"
func suicide() error {
handle, err := syscall.GetCurrentProcess()
if err != nil {
return err
}
return syscall.TerminateProcess(handle, uint32(syscall.SIGTERM))
}

View file

@ -74,8 +74,6 @@ function lxc_transaction_begin() {
lxc_transaction_lock lxc_transaction_lock
lxc_container_destroy $draft lxc_container_destroy $draft
echo $draft
} }
function lxc_transaction_commit() { function lxc_transaction_commit() {
@ -387,11 +385,14 @@ function lxc_running() {
function lxc_build_template_release() { function lxc_build_template_release() {
local name="$(lxc_template_release)" local name="$(lxc_template_release)"
lxc_transaction_begin $name
if lxc_exists_and_apt_not_old $name; then if lxc_exists_and_apt_not_old $name; then
lxc_transaction_unlock
return return
fi fi
local draft=$(lxc_transaction_begin $name) local draft=$(lxc_transaction_draft_name)
$LXC_SUDO lxc-create --name $draft --template debian -- --release=$LXC_CONTAINER_RELEASE $LXC_SUDO lxc-create --name $draft --template debian -- --release=$LXC_CONTAINER_RELEASE
echo 'lxc.apparmor.profile = unconfined' | $LXC_SUDO tee -a $(lxc_config $draft) echo 'lxc.apparmor.profile = unconfined' | $LXC_SUDO tee -a $(lxc_config $draft)
lxc_container_install_lxc_helpers $draft lxc_container_install_lxc_helpers $draft
@ -406,15 +407,17 @@ function lxc_build_template() {
local name="$1" local name="$1"
local newname="$2" local newname="$2"
if lxc_exists_and_apt_not_old $newname; then
return
fi
if test "$name" = "$(lxc_template_release)"; then if test "$name" = "$(lxc_template_release)"; then
lxc_build_template_release lxc_build_template_release
fi fi
local draft=$(lxc_transaction_begin $newname) lxc_transaction_begin $name
if lxc_exists_and_apt_not_old $newname; then
lxc_transaction_unlock
return
fi
local draft=$(lxc_transaction_draft_name)
if ! $LXC_SUDO lxc-copy --name=$name --newname=$draft; then if ! $LXC_SUDO lxc-copy --name=$name --newname=$draft; then
echo lxc-copy --name=$name --newname=$draft failed echo lxc-copy --name=$name --newname=$draft failed
return 1 return 1

View file

@ -193,6 +193,8 @@ var lxcHelpers string
var startTemplate = template.Must(template.New("start").Parse(`#!/bin/bash -e var startTemplate = template.Must(template.New("start").Parse(`#!/bin/bash -e
exec 5<>/tmp/forgejo-runner-lxc.lock ; flock --timeout 21600 5
LXC_CONTAINER_CONFIG="{{.Config}}" LXC_CONTAINER_CONFIG="{{.Config}}"
LXC_CONTAINER_RELEASE="{{.Release}}" LXC_CONTAINER_RELEASE="{{.Release}}"

View file

@ -1,4 +1,4 @@
FROM alpine:3 FROM code.forgejo.org/oci/alpine:latest
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh

View file

@ -242,7 +242,7 @@ jobs:
name: Build Silo Frontend DEV name: Build Silo Frontend DEV
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: code.forgejo.org/oci/node:22-bookworm image: code.forgejo.org/oci/${{ env.IMAGE }}
uses: ./.forgejo/workflows/${{ vars.PATHNAME }} uses: ./.forgejo/workflows/${{ vars.PATHNAME }}
with: with:
STAGE: dev STAGE: dev

View file

@ -2008,7 +2008,7 @@
}, },
"container": { "container": {
"description": "A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.\n\nIf you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.", "description": "A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.\n\nIf you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.",
"context": ["forge", "forgejo", "github", "inputs", "vars", "needs", "strategy", "matrix"], "context": ["forge", "forgejo", "github", "inputs", "vars", "needs", "strategy", "matrix", "env"],
"one-of": ["string", "container-mapping"] "one-of": ["string", "container-mapping"]
}, },
"container-mapping": { "container-mapping": {

View file

@ -20,7 +20,7 @@ trap "rm -fr $TMPDIR" EXIT
: ${INPUTS_TOKEN:=} : ${INPUTS_TOKEN:=}
: ${INPUTS_FORGEJO:=https://code.forgejo.org} : ${INPUTS_FORGEJO:=https://code.forgejo.org}
: ${INPUTS_LIFETIME:=7d} : ${INPUTS_LIFETIME:=7d}
DEFAULT_LXC_HELPERS_VERSION=1.1.1 # renovate: datasource=forgejo-tags depName=forgejo/lxc-helpers DEFAULT_LXC_HELPERS_VERSION=1.1.3 # renovate: datasource=forgejo-tags depName=forgejo/lxc-helpers
: ${INPUTS_LXC_HELPERS_VERSION:=$DEFAULT_LXC_HELPERS_VERSION} : ${INPUTS_LXC_HELPERS_VERSION:=$DEFAULT_LXC_HELPERS_VERSION}
DEFAULT_RUNNER_VERSION=11.1.2 # renovate: datasource=forgejo-releases depName=forgejo/runner DEFAULT_RUNNER_VERSION=11.1.2 # renovate: datasource=forgejo-releases depName=forgejo/runner
: ${INPUTS_RUNNER_VERSION:=$DEFAULT_RUNNER_VERSION} : ${INPUTS_RUNNER_VERSION:=$DEFAULT_RUNNER_VERSION}

View file

@ -36,11 +36,20 @@ func NewJob(cfg *config.Config, client client.Client, runner run.RunnerInterface
} }
func (j *Job) Run(ctx context.Context) error { func (j *Job) Run(ctx context.Context) error {
task, ok := j.fetchTask(ctx) log.Info("Polling for a job...")
if !ok { for {
return fmt.Errorf("could not fetch task") task, ok := j.fetchTask(ctx)
if ok {
return j.runTaskWithRecover(ctx, task)
}
// No task available, continue polling
select {
case <-ctx.Done():
return ctx.Err()
default:
// Continue to next iteration
}
} }
return j.runTaskWithRecover(ctx, task)
} }
func (j *Job) runTaskWithRecover(ctx context.Context, task *runnerv1.Task) error { func (j *Job) runTaskWithRecover(ctx context.Context, task *runnerv1.Task) error {