Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7a9da9e

Browse files
committedAug 5, 2021
Use workflow variables for tool versions in all workflows
Placement of this information at the top of the file, where it is easy to find and edit, facilitates updates to the workflows as the tool version used for project development are bumped periodically. This is an established convention in the "template" workflows, but I missed some applications of it. I think it's most effective when done consistently throughout the workflows.
1 parent 3b1c9a3 commit 7a9da9e

5 files changed

+28
-6
lines changed
 

‎.github/workflows/check-code-generation-task.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Check Code Generation
22

3+
env:
4+
# See: https://github.com/actions/setup-go/tree/v2#readme
5+
GO_VERSION: "1.16"
6+
37
on:
48
push:
59
paths:
@@ -29,7 +33,7 @@ jobs:
2933
- name: Install Go
3034
uses: actions/setup-go@v2
3135
with:
32-
go-version: "1.16"
36+
go-version: ${{ env.GO_VERSION }}
3337

3438
- name: Install Taskfile
3539
uses: arduino/setup-task@v1

‎.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/deploy-cobra-mkdocs-versioned-poetry.md
22
name: Deploy Website
33

4+
env:
5+
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
6+
PYTHON_VERSION: "3.9"
7+
48
on:
59
push:
610
branches:
@@ -52,7 +56,7 @@ jobs:
5256
- name: Install Python
5357
uses: actions/setup-python@v2
5458
with:
55-
python-version: "3.9"
59+
python-version: ${{ env.PYTHON_VERSION }}
5660

5761
- name: Install Poetry
5862
run: |

‎.github/workflows/spell-check-task.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md
22
name: Spell Check
33

4+
env:
5+
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
6+
PYTHON_VERSION: "3.9"
7+
48
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
59
on:
610
push:
@@ -22,7 +26,7 @@ jobs:
2226
- name: Install Python
2327
uses: actions/setup-python@v2
2428
with:
25-
python-version: "3.9"
29+
python-version: ${{ env.PYTHON_VERSION }}
2630

2731
- name: Install Poetry
2832
run: pip install poetry

‎.github/workflows/test-go-integration-task.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Test Integration
22

3+
env:
4+
# See: https://github.com/actions/setup-go/tree/v2#readme
5+
GO_VERSION: "1.16"
6+
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
7+
PYTHON_VERSION: "3.9"
8+
39
on:
410
push:
511
paths:
@@ -40,7 +46,7 @@ jobs:
4046
- name: Install Go
4147
uses: actions/setup-go@v2
4248
with:
43-
go-version: "1.16"
49+
go-version: ${{ env.GO_VERSION }}
4450

4551
- name: Install Taskfile
4652
uses: arduino/setup-task@v1
@@ -51,7 +57,7 @@ jobs:
5157
- name: Install Python
5258
uses: actions/setup-python@v2
5359
with:
54-
python-version: "3.9"
60+
python-version: ${{ env.PYTHON_VERSION }}
5561

5662
- name: Install Poetry
5763
run: pip install poetry

‎.github/workflows/test-go-task.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Run tests
22

3+
env:
4+
# See: https://github.com/actions/setup-go/tree/v2#readme
5+
GO_VERSION: "1.16"
6+
37
on:
48
push:
59
paths:
@@ -36,7 +40,7 @@ jobs:
3640
- name: Install Go
3741
uses: actions/setup-go@v2
3842
with:
39-
go-version: "1.16"
43+
go-version: ${{ env.GO_VERSION }}
4044

4145
- name: Install Taskfile
4246
uses: arduino/setup-task@v1

0 commit comments

Comments
 (0)
Please sign in to comment.