Skip to content

Commit 496aa60

Browse files
committed
Use workflow variables to define tool versions
Placement of this information at the top of the GitHub Actions workflow files, where it is easy to find and edit, facilitates updates to the workflows as the tool versions used for project development are bumped periodically.
1 parent c82dedf commit 496aa60

File tree

6 files changed

+59
-8
lines changed

6 files changed

+59
-8
lines changed

.github/workflows/check-go-task.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Check Go
22

3+
env:
4+
# See: https://github.com/actions/setup-go/tree/v2#readme
5+
GO_VERSION: "1.14"
6+
37
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
48
on:
59
push:
@@ -30,6 +34,11 @@ jobs:
3034
- name: Checkout repository
3135
uses: actions/checkout@v2
3236

37+
- name: Install Go
38+
uses: actions/setup-go@v2
39+
with:
40+
go-version: ${{ env.GO_VERSION }}
41+
3342
- name: Install Task
3443
uses: arduino/setup-task@v1
3544
with:
@@ -46,6 +55,11 @@ jobs:
4655
- name: Checkout repository
4756
uses: actions/checkout@v2
4857

58+
- name: Install Go
59+
uses: actions/setup-go@v2
60+
with:
61+
go-version: ${{ env.GO_VERSION }}
62+
4963
- name: Install Task
5064
uses: arduino/setup-task@v1
5165
with:
@@ -65,6 +79,11 @@ jobs:
6579
- name: Checkout repository
6680
uses: actions/checkout@v2
6781

82+
- name: Install Go
83+
uses: actions/setup-go@v2
84+
with:
85+
go-version: ${{ env.GO_VERSION }}
86+
6887
- name: Install Task
6988
uses: arduino/setup-task@v1
7089
with:
@@ -81,6 +100,11 @@ jobs:
81100
- name: Checkout repository
82101
uses: actions/checkout@v2
83102

103+
- name: Install Go
104+
uses: actions/setup-go@v2
105+
with:
106+
go-version: ${{ env.GO_VERSION }}
107+
84108
- name: Install Task
85109
uses: arduino/setup-task@v1
86110
with:
@@ -100,6 +124,11 @@ jobs:
100124
- name: Checkout repository
101125
uses: actions/checkout@v2
102126

127+
- name: Install Go
128+
uses: actions/setup-go@v2
129+
with:
130+
go-version: ${{ env.GO_VERSION }}
131+
103132
- name: Run go mod tidy
104133
run: go mod tidy
105134

.github/workflows/check-python-task.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Check Python
22

3+
env:
4+
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
5+
PYTHON_VERSION: "3.9"
6+
37
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
48
on:
59
push:
@@ -36,7 +40,7 @@ jobs:
3640
- name: Install Python
3741
uses: actions/setup-python@v2
3842
with:
39-
python-version: "3.9"
43+
python-version: ${{ env.PYTHON_VERSION }}
4044

4145
- name: Install Poetry
4246
run: pip install poetry
@@ -60,7 +64,7 @@ jobs:
6064
- name: Install Python
6165
uses: actions/setup-python@v2
6266
with:
63-
python-version: "3.9"
67+
python-version: ${{ env.PYTHON_VERSION }}
6468

6569
- name: Install Poetry
6670
run: pip install poetry

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Create Release
22

3+
env:
4+
# See: https://github.com/actions/setup-go/tree/v2#readme
5+
GO_VERSION: "1.14"
6+
37
on:
48
push:
59
tags:
@@ -32,7 +36,7 @@ jobs:
3236
- name: Install Go
3337
uses: actions/setup-go@v2
3438
with:
35-
go-version: "1.14"
39+
go-version: ${{ env.GO_VERSION }}
3640

3741
- name: Build project
3842
run: task build

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Spell Check
22

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

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

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

Lines changed: 8 additions & 2 deletions
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.14"
6+
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
7+
PYTHON_VERSION: "3.9"
8+
39
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
410
on:
511
push:
@@ -46,12 +52,12 @@ jobs:
4652
- name: Install Go
4753
uses: actions/setup-go@v2
4854
with:
49-
go-version: "1.14"
55+
go-version: ${{ env.GO_VERSION }}
5056

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Test Go
22

3+
env:
4+
# See: https://github.com/actions/setup-go/tree/v2#readme
5+
GO_VERSION: "1.14"
6+
37
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
48
on:
59
push:
@@ -32,7 +36,7 @@ jobs:
3236
- name: Install Go
3337
uses: actions/setup-go@v2
3438
with:
35-
go-version: "1.14"
39+
go-version: ${{ env.GO_VERSION }}
3640

3741
- name: Install Taskfile
3842
uses: arduino/setup-task@v1
@@ -60,7 +64,7 @@ jobs:
6064
- name: Install Go
6165
uses: actions/setup-go@v2
6266
with:
63-
go-version: "1.14"
67+
go-version: ${{ env.GO_VERSION }}
6468

6569
- name: Install Arduino Lint
6670
run: |

0 commit comments

Comments
 (0)