Skip to content

Commit 51bd6a7

Browse files
committed
Apply update of workflows from asset repo
1 parent f3a38e9 commit 51bd6a7

18 files changed

+1798
-85
lines changed

Diff for: .github/workflows/check-general-formatting-task.yml

+33-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-general-formatting-task.md
22
name: Check General Formatting
33

4-
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
4+
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
55
on:
6+
create:
67
push:
78
pull_request:
89
schedule:
@@ -12,20 +13,48 @@ on:
1213
repository_dispatch:
1314

1415
jobs:
16+
run-determination:
17+
runs-on: ubuntu-latest
18+
permissions: {}
19+
outputs:
20+
result: ${{ steps.determination.outputs.result }}
21+
steps:
22+
- name: Determine if the rest of the workflow should run
23+
id: determination
24+
run: |
25+
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
26+
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
27+
if [[
28+
"${{ github.event_name }}" != "create" ||
29+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
30+
]]; then
31+
# Run the other jobs.
32+
RESULT="true"
33+
else
34+
# There is no need to run the other jobs.
35+
RESULT="false"
36+
fi
37+
38+
echo "result=$RESULT" >> $GITHUB_OUTPUT
39+
1540
check:
41+
needs: run-determination
42+
if: needs.run-determination.outputs.result == 'true'
1643
runs-on: ubuntu-latest
44+
permissions:
45+
contents: read
1746

1847
steps:
1948
- name: Set environment variables
2049
run: |
21-
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
50+
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
2251
echo "EC_INSTALL_PATH=${{ runner.temp }}/editorconfig-checker" >> "$GITHUB_ENV"
2352
2453
- name: Checkout repository
2554
uses: actions/checkout@v4
2655

2756
- name: Install Task
28-
uses: arduino/setup-task@v1
57+
uses: arduino/setup-task@v2
2958
with:
3059
repo-token: ${{ secrets.GITHUB_TOKEN }}
3160
version: 3.x
@@ -46,7 +75,7 @@ jobs:
4675
# Give the binary a standard name
4776
mv "${{ env.EC_INSTALL_PATH }}/bin/ec-linux-amd64" "${{ env.EC_INSTALL_PATH }}/bin/ec"
4877
# Add installation to PATH:
49-
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
78+
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
5079
echo "${{ env.EC_INSTALL_PATH }}/bin" >> "$GITHUB_PATH"
5180
5281
- name: Check formatting

Diff for: .github/workflows/check-go-dependencies-task.yml

+20-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Check Go Dependencies
33

44
env:
5-
# See: https://github.com/actions/setup-go/tree/v3#readme
5+
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
66
GO_VERSION: "1.18"
77

88
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
@@ -37,6 +37,7 @@ on:
3737
jobs:
3838
run-determination:
3939
runs-on: ubuntu-latest
40+
permissions: {}
4041
outputs:
4142
result: ${{ steps.determination.outputs.result }}
4243
steps:
@@ -62,13 +63,21 @@ jobs:
6263
needs: run-determination
6364
if: needs.run-determination.outputs.result == 'true'
6465
runs-on: ubuntu-latest
66+
permissions:
67+
contents: read
6568

6669
steps:
6770
- name: Checkout repository
6871
uses: actions/checkout@v4
6972
with:
7073
submodules: recursive
7174

75+
# This is required to allow jonabc/setup-licensed to install licensed via Ruby gem.
76+
- name: Install Ruby
77+
uses: ruby/setup-ruby@v1
78+
with:
79+
ruby-version: ruby # Install latest version
80+
7281
- name: Install licensed
7382
uses: jonabc/setup-licensed@v1
7483
with:
@@ -81,7 +90,7 @@ jobs:
8190
go-version: ${{ env.GO_VERSION }}
8291

8392
- name: Install Task
84-
uses: arduino/setup-task@v1
93+
uses: arduino/setup-task@v2
8594
with:
8695
repo-token: ${{ secrets.GITHUB_TOKEN }}
8796
version: 3.x
@@ -112,13 +121,21 @@ jobs:
112121
needs: run-determination
113122
if: needs.run-determination.outputs.result == 'true'
114123
runs-on: ubuntu-latest
124+
permissions:
125+
contents: read
115126

116127
steps:
117128
- name: Checkout repository
118129
uses: actions/checkout@v4
119130
with:
120131
submodules: recursive
121132

133+
# This is required to allow jonabc/setup-licensed to install licensed via Ruby gem.
134+
- name: Install Ruby
135+
uses: ruby/setup-ruby@v1
136+
with:
137+
ruby-version: ruby # Install latest version
138+
122139
- name: Install licensed
123140
uses: jonabc/setup-licensed@v1
124141
with:
@@ -131,7 +148,7 @@ jobs:
131148
go-version: ${{ env.GO_VERSION }}
132149

133150
- name: Install Task
134-
uses: arduino/setup-task@v1
151+
uses: arduino/setup-task@v2
135152
with:
136153
repo-token: ${{ secrets.GITHUB_TOKEN }}
137154
version: 3.x

Diff for: .github/workflows/check-markdown-task.yml

+53-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ name: Check Markdown
44
env:
55
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
66
GO_VERSION: "1.18"
7+
# See: https://github.com/actions/setup-node/#readme
8+
NODE_VERSION: 16.x
79

8-
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
10+
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
911
on:
12+
create:
1013
push:
1114
paths:
1215
- ".github/workflows/check-markdown-task.ya?ml"
1316
- ".markdown-link-check.json"
17+
- "package.json"
18+
- "package-lock.json"
1419
- "Taskfile.ya?ml"
1520
- "**/.markdownlint*"
1621
- "**.mdx?"
@@ -21,6 +26,8 @@ on:
2126
paths:
2227
- ".github/workflows/check-markdown-task.ya?ml"
2328
- ".markdown-link-check.json"
29+
- "package.json"
30+
- "package-lock.json"
2431
- "Taskfile.ya?ml"
2532
- "**/.markdownlint*"
2633
- "**.mdx?"
@@ -34,18 +41,51 @@ on:
3441
repository_dispatch:
3542

3643
jobs:
44+
run-determination:
45+
runs-on: ubuntu-latest
46+
permissions: {}
47+
outputs:
48+
result: ${{ steps.determination.outputs.result }}
49+
steps:
50+
- name: Determine if the rest of the workflow should run
51+
id: determination
52+
run: |
53+
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
54+
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
55+
if [[
56+
"${{ github.event_name }}" != "create" ||
57+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
58+
]]; then
59+
# Run the other jobs.
60+
RESULT="true"
61+
else
62+
# There is no need to run the other jobs.
63+
RESULT="false"
64+
fi
65+
66+
echo "result=$RESULT" >> $GITHUB_OUTPUT
67+
3768
lint:
69+
needs: run-determination
70+
if: needs.run-determination.outputs.result == 'true'
3871
runs-on: ubuntu-latest
72+
permissions:
73+
contents: read
3974

4075
steps:
4176
- name: Checkout repository
4277
uses: actions/checkout@v4
4378

79+
- name: Setup Node.js
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: ${{ env.NODE_VERSION }}
83+
4484
- name: Initialize markdownlint-cli problem matcher
45-
uses: xt0rted/markdownlint-problem-matcher@v2
85+
uses: xt0rted/markdownlint-problem-matcher@v3
4686

4787
- name: Install Task
48-
uses: arduino/setup-task@v1
88+
uses: arduino/setup-task@v2
4989
with:
5090
repo-token: ${{ secrets.GITHUB_TOKEN }}
5191
version: 3.x
@@ -54,7 +94,11 @@ jobs:
5494
run: task markdown:lint
5595

5696
links:
97+
needs: run-determination
98+
if: needs.run-determination.outputs.result == 'true'
5799
runs-on: ubuntu-latest
100+
permissions:
101+
contents: read
58102

59103
steps:
60104
- name: Checkout repository
@@ -65,8 +109,13 @@ jobs:
65109
with:
66110
go-version: ${{ env.GO_VERSION }}
67111

112+
- name: Setup Node.js
113+
uses: actions/setup-node@v4
114+
with:
115+
node-version: ${{ env.NODE_VERSION }}
116+
68117
- name: Install Task
69-
uses: arduino/setup-task@v1
118+
uses: arduino/setup-task@v2
70119
with:
71120
repo-token: ${{ secrets.GITHUB_TOKEN }}
72121
version: 3.x

Diff for: .github/workflows/check-mkdocs-task.yml

+32-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ name: Check Website
44
env:
55
# See: https://github.com/actions/setup-go/tree/v2#readme
66
GO_VERSION: "1.18"
7-
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
7+
# See: https://github.com/actions/setup-python/tree/main#available-versions-of-python
88
PYTHON_VERSION: "3.9"
99

10-
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
10+
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
1111
on:
12+
create:
1213
push:
1314
paths:
1415
- ".github/workflows/check-mkdocs-task.ya?ml"
@@ -37,8 +38,36 @@ on:
3738
repository_dispatch:
3839

3940
jobs:
41+
run-determination:
42+
runs-on: ubuntu-latest
43+
permissions: {}
44+
outputs:
45+
result: ${{ steps.determination.outputs.result }}
46+
steps:
47+
- name: Determine if the rest of the workflow should run
48+
id: determination
49+
run: |
50+
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
51+
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
52+
if [[
53+
"${{ github.event_name }}" != "create" ||
54+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
55+
]]; then
56+
# Run the other jobs.
57+
RESULT="true"
58+
else
59+
# There is no need to run the other jobs.
60+
RESULT="false"
61+
fi
62+
63+
echo "result=$RESULT" >> $GITHUB_OUTPUT
64+
4065
check:
66+
needs: run-determination
67+
if: needs.run-determination.outputs.result == 'true'
4168
runs-on: ubuntu-latest
69+
permissions:
70+
contents: read
4271

4372
steps:
4473
- name: Checkout repository
@@ -58,7 +87,7 @@ jobs:
5887
run: pip install poetry
5988

6089
- name: Install Task
61-
uses: arduino/setup-task@v1
90+
uses: arduino/setup-task@v2
6291
with:
6392
repo-token: ${{ secrets.GITHUB_TOKEN }}
6493
version: 3.x

Diff for: .github/workflows/check-prettier-formatting-task.yml

+40-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-prettier-formatting-task.md
22
name: Check Prettier Formatting
33

4-
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
env:
5+
# See: https://github.com/actions/setup-node/#readme
6+
NODE_VERSION: 16.x
7+
8+
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
59
on:
10+
create:
611
push:
712
paths:
813
- ".github/workflows/check-prettier-formatting-task.ya?ml"
@@ -199,15 +204,48 @@ on:
199204
repository_dispatch:
200205

201206
jobs:
207+
run-determination:
208+
runs-on: ubuntu-latest
209+
permissions: {}
210+
outputs:
211+
result: ${{ steps.determination.outputs.result }}
212+
steps:
213+
- name: Determine if the rest of the workflow should run
214+
id: determination
215+
run: |
216+
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
217+
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
218+
if [[
219+
"${{ github.event_name }}" != "create" ||
220+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
221+
]]; then
222+
# Run the other jobs.
223+
RESULT="true"
224+
else
225+
# There is no need to run the other jobs.
226+
RESULT="false"
227+
fi
228+
229+
echo "result=$RESULT" >> $GITHUB_OUTPUT
230+
202231
check:
232+
needs: run-determination
233+
if: needs.run-determination.outputs.result == 'true'
203234
runs-on: ubuntu-latest
235+
permissions:
236+
contents: read
204237

205238
steps:
206239
- name: Checkout repository
207240
uses: actions/checkout@v4
208241

242+
- name: Setup Node.js
243+
uses: actions/setup-node@v4
244+
with:
245+
node-version: ${{ env.NODE_VERSION }}
246+
209247
- name: Install Task
210-
uses: arduino/setup-task@v1
248+
uses: arduino/setup-task@v2
211249
with:
212250
repo-token: ${{ secrets.GITHUB_TOKEN }}
213251
version: 3.x

0 commit comments

Comments
 (0)