Skip to content

Commit

Permalink
Merge pull request #801 from per1234/go_mod-versioning
Browse files Browse the repository at this point in the history
Use `go.mod` as source of Go version number for workflows
  • Loading branch information
per1234 authored Nov 22, 2024
2 parents f93350f + 79de0f2 commit b56dadf
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 51 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/check-code-generation-task.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Check Code Generation

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.22"

on:
create:
push:
Expand Down Expand Up @@ -61,7 +57,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md
name: Check Go Dependencies

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.22"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -87,7 +83,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -146,7 +142,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/check-go-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-task.md
name: Check Go

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.22"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -77,7 +73,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -114,7 +110,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -154,7 +150,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -194,7 +190,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -234,7 +230,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-markdown-task.md
name: Check Markdown

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.22"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand All @@ -17,6 +13,8 @@ on:
- "package-lock.json"
- "Taskfile.ya?ml"
- "**/.markdownlint*"
- "**/go.mod"
- "**/go.sum"
- "**.mdx?"
- "**.mkdn"
- "**.mdown"
Expand All @@ -30,6 +28,8 @@ on:
- "package-lock.json"
- "Taskfile.ya?ml"
- "**/.markdownlint*"
- "**/go.mod"
- "**/go.sum"
- "**.mdx?"
- "**.mkdn"
- "**.mdown"
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/check-mkdocs-task.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-mkdocs-task.md
name: Check Website

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.22"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-mkdocs-task.ya?ml"
- "**/.npmrc"
- "**/go.mod"
- "**/go.sum"
- "Taskfile.ya?ml"
- "mkdocs.ya?ml"
- "package.json"
Expand All @@ -26,6 +24,8 @@ on:
paths:
- ".github/workflows/check-mkdocs-task.ya?ml"
- "**/.npmrc"
- "**/go.mod"
- "**/go.sum"
- "Taskfile.ya?ml"
- "mkdocs.ya?ml"
- "package.json"
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Python
uses: actions/setup-python@v5
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/deploy-cobra-mkdocs-versioned-poetry.md
name: Deploy Website

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.22"

on:
push:
branches:
Expand Down Expand Up @@ -69,7 +65,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Python
uses: actions/setup-python@v5
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test-go-integration-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/test-go-integration-task.md
name: Test Integration

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.22"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -81,7 +77,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Python
uses: actions/setup-python@v5
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/test-go-task.md
name: Test Go

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.22"

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -91,7 +87,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
7 changes: 4 additions & 3 deletions DistTasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ version: "3"

vars:
CONTAINER: "docker.elastic.co/beats-dev/golang-crossbuild"
GO_VERSION: "1.22.5"
GO_VERSION: "1.22.9"

tasks:
Windows_32bit:
Expand Down Expand Up @@ -131,11 +131,12 @@ tasks:
desc: Builds Linux ARMv6 binaries
dir: "{{.DIST_DIR}}"
cmds:
# "git config safe.directory" is required until this is fixed https://github.com/elastic/golang-crossbuild/issues/232
- |
docker run -v `pwd`/..:/home/build -w /home/build \
-e CGO_ENABLED=0 \
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
--build-cmd "{{.BUILD_COMMAND}}" \
--build-cmd "git config --global --add safe.directory /home/build && {{.BUILD_COMMAND}}" \
-p "{{.BUILD_PLATFORM}}"
tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}}
Expand Down Expand Up @@ -172,7 +173,7 @@ tasks:
#
# Until there is a fix released we must use a recent gcc for Linux_ARMv6 build, so for this
# build we select the debian10 based container.
CONTAINER_TAG: "{{.GO_VERSION}}-armel-debian9"
CONTAINER_TAG: "{{.GO_VERSION}}-armel-debian12"
PACKAGE_PLATFORM: "Linux_ARMv6"
PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz"

Expand Down
2 changes: 1 addition & 1 deletion docsgen/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/cobra/docsgen/go.mod
module github.com/arduino/arduino-lint/docsgen

go 1.22.3
go 1.22.9

replace github.com/arduino/arduino-lint => ../

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/arduino/arduino-lint

go 1.22.3
go 1.22.9

replace github.com/jandelgado/gcov2lcov => github.com/jandelgado/gcov2lcov v1.0.5 // v1.0.4 causes Dependabot updates to fail due to checksum mismatch (likely a moved tag). This is an unused transitive dependency, so version is irrelevant.

Expand Down
2 changes: 1 addition & 1 deletion ruledocsgen/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/arduino/arduino-lint/ruledocsgen

go 1.22.3
go 1.22.9

replace github.com/arduino/arduino-lint => ../

Expand Down

0 comments on commit b56dadf

Please sign in to comment.