From 03e34e3de788b1d8b135e8c746732c4680fa3449 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 25 Jun 2025 10:24:28 +0200 Subject: [PATCH 1/5] go.mod: don't enforce go1.23.5 patch version commit 08fb086bc2859b5a5b29509ed8fead3421d781f9 added a go.mod, but set the minimum required version to the patch version. Generally, go versions in go.mod, like other dependencies, follow "MVS" (minimum version selection) conventions, and specify the lowest possible / supported minimum version. Keeping the version low avoids unnecessary code churn in projects using this module. Signed-off-by: Sebastiaan van Stijn --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 53784cd..930ee1b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/fluent/fluent-logger-golang -go 1.23.5 +go 1.23.0 require github.com/tinylib/msgp v1.3.0 From 9313c70a2a837e57cfcac69e9aebdc68b879e8a2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 25 Jun 2025 10:35:48 +0200 Subject: [PATCH 2/5] gha: test against oldest supported and current go versions Also set GOTOOLCHAIN to "local" to prevent changes in go.mod to override the version used in tests. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/ci.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d944099..75bbd24 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,9 +14,16 @@ jobs: strategy: matrix: os: [ubuntu, macos, windows] - golang: ['1.23', '1.24'] + # test oldest supported version and currently maintained Go versions. + golang: ['1.23.x', 'oldstable', 'stable'] # currently, we cannot run non-x86_64 machines on GitHub Actions cloud env. runs-on: ${{ matrix.os }}-latest + env: + # Setting GOTOOLCHAIN to local tells go + # to use the bundled Go version rather + # than fetching the toolchain according to + # toolchain directive found in go.mod. + GOTOOLCHAIN: local name: CI golang ${{ matrix.golang }} on ${{ matrix.os }} steps: - uses: actions/checkout@v4 From 4f5b24754648ed50fac50eb79a212330fc9801ce Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 25 Jun 2025 10:37:16 +0200 Subject: [PATCH 3/5] gha: simplify selection of branches Omit selecting branches; by default any branch is included. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/ci.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 75bbd24..fcb676d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,13 +1,6 @@ name: ci -on: - pull_request: - branches: '*' - push: - branches: - - master - - main - - 'release-*' +on: [push, pull_request] jobs: test: From 6f132ae2ba14ee8cdc3fe802dcce54a8bb18f6fa Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 25 Jun 2025 10:39:18 +0200 Subject: [PATCH 4/5] gha: set default permissions to "read" only Signed-off-by: Sebastiaan van Stijn --- .github/workflows/ci.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fcb676d..5af3ccf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,14 @@ name: ci +# Default to 'contents: read', which grants actions to read commits. +# +# If any permission is set, any permission not included in the list is +# implicitly set to "none". +# +# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions +permissions: + contents: read + on: [push, pull_request] jobs: From 0531d5a8ec69b45ed601f9cea21aa8fa84b71235 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 25 Jun 2025 10:40:13 +0200 Subject: [PATCH 5/5] gha: set default timeout GitHub's default timeout is 6 hours, which is really long. Set a more reasonable timeout to prevent "runnaway" runs from running for hours before timing out. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5af3ccf..3fe0498 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,6 +20,7 @@ jobs: golang: ['1.23.x', 'oldstable', 'stable'] # currently, we cannot run non-x86_64 machines on GitHub Actions cloud env. runs-on: ${{ matrix.os }}-latest + timeout-minutes: 10 # guardrails timeout for the whole job env: # Setting GOTOOLCHAIN to local tells go # to use the bundled Go version rather