Skip to content

Commit ce63040

Browse files
authored
Merge pull request #20 from per1234/sync-ci
Sync infrastructure assets from upstream
2 parents a04cede + 812a8c0 commit ce63040

23 files changed

+3835
-58
lines changed

Diff for: .codespellrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[codespell]
44
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
55
ignore-words-list = ,
6-
skip = ./.git,./go.mod,./go.sum,./package-lock.json,./poetry.lock,./yarn.lock
6+
skip = ./.git,./.licenses,__pycache__,node_modules,./go.mod,./go.sum,./package-lock.json,./poetry.lock,./yarn.lock
77
builtin = clear,informal,en-GB_to_en-US
88
check-filenames =
99
check-hidden =

Diff for: .ecrc

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"Exclude": [
3+
"^\\.git[/\\\\]",
4+
"^\\.licenses[/\\\\]",
5+
"__pycache__[/\\\\]",
6+
"node_modules[/\\\\]",
37
"^LICENSE\\.txt$",
48
"^poetry\\.lock$"
59
]

Diff for: .github/dependabot.yml

+18
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,21 @@ updates:
1111
interval: daily
1212
labels:
1313
- "topic: infrastructure"
14+
15+
- package-ecosystem: npm
16+
directory: /
17+
schedule:
18+
interval: daily
19+
labels:
20+
- "topic: infrastructure"
21+
assignees:
22+
- per1234
23+
24+
- package-ecosystem: pip
25+
directory: /
26+
schedule:
27+
interval: daily
28+
labels:
29+
- "topic: infrastructure"
30+
assignees:
31+
- per1234

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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:
66
push:
77
pull_request:
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- name: Set environment variables
2020
run: |
21-
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
21+
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
2222
echo "EC_INSTALL_PATH=${{ runner.temp }}/editorconfig-checker" >> "$GITHUB_ENV"
2323
2424
- name: Checkout repository
@@ -46,7 +46,7 @@ jobs:
4646
# Give the binary a standard name
4747
mv "${{ env.EC_INSTALL_PATH }}/bin/ec-linux-amd64" "${{ env.EC_INSTALL_PATH }}/bin/ec"
4848
# Add installation to PATH:
49-
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
49+
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
5050
echo "${{ env.EC_INSTALL_PATH }}/bin" >> "$GITHUB_PATH"
5151
5252
- name: Check formatting

Diff for: .github/workflows/check-license.yml

+30-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ env:
66
# SPDX identifier: https://spdx.org/licenses/
77
EXPECTED_LICENSE_TYPE: GPL-3.0
88

9-
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
9+
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
1010
on:
11+
create:
1112
push:
1213
paths:
1314
- ".github/workflows/check-license.ya?ml"
@@ -25,11 +26,39 @@ on:
2526
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
2627
- "[oO][fF][lL]*"
2728
- "[pP][aA][tT][eE][nN][tT][sS]*"
29+
schedule:
30+
# Run periodically to catch breakage caused by external changes.
31+
- cron: "0 6 * * WED"
2832
workflow_dispatch:
2933
repository_dispatch:
3034

3135
jobs:
36+
run-determination:
37+
runs-on: ubuntu-latest
38+
outputs:
39+
result: ${{ steps.determination.outputs.result }}
40+
steps:
41+
- name: Determine if the rest of the workflow should run
42+
id: determination
43+
run: |
44+
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
45+
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
46+
if [[
47+
"${{ github.event_name }}" != "create" ||
48+
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
49+
]]; then
50+
# Run the other jobs.
51+
RESULT="true"
52+
else
53+
# There is no need to run the other jobs.
54+
RESULT="false"
55+
fi
56+
57+
echo "::set-output name=result::$RESULT"
58+
3259
check-license:
60+
needs: run-determination
61+
if: needs.run-determination.outputs.result == 'true'
3362
runs-on: ubuntu-latest
3463

3564
steps:

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

+47-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-markdown-task.md
22
name: Check Markdown
33

4-
# See: https://docs.github.com/en/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-markdown-task.ya?ml"
914
- ".markdown-link-check.json"
15+
- "package.json"
16+
- "package-lock.json"
1017
- "Taskfile.ya?ml"
1118
- "**/.markdownlint*"
1219
- "**.mdx?"
@@ -17,6 +24,8 @@ on:
1724
paths:
1825
- ".github/workflows/check-markdown-task.ya?ml"
1926
- ".markdown-link-check.json"
27+
- "package.json"
28+
- "package-lock.json"
2029
- "Taskfile.ya?ml"
2130
- "**/.markdownlint*"
2231
- "**.mdx?"
@@ -30,13 +39,43 @@ on:
3039
repository_dispatch:
3140

3241
jobs:
42+
run-determination:
43+
runs-on: ubuntu-latest
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 "::set-output name=result::$RESULT"
64+
3365
lint:
66+
needs: run-determination
67+
if: needs.run-determination.outputs.result == 'true'
3468
runs-on: ubuntu-latest
3569

3670
steps:
3771
- name: Checkout repository
3872
uses: actions/checkout@v3
3973

74+
- name: Setup Node.js
75+
uses: actions/setup-node@v3
76+
with:
77+
node-version: ${{ env.NODE_VERSION }}
78+
4079
- name: Initialize markdownlint-cli problem matcher
4180
uses: xt0rted/markdownlint-problem-matcher@v1
4281

@@ -50,12 +89,19 @@ jobs:
5089
run: task markdown:lint
5190

5291
links:
92+
needs: run-determination
93+
if: needs.run-determination.outputs.result == 'true'
5394
runs-on: ubuntu-latest
5495

5596
steps:
5697
- name: Checkout repository
5798
uses: actions/checkout@v3
5899

100+
- name: Setup Node.js
101+
uses: actions/setup-node@v3
102+
with:
103+
node-version: ${{ env.NODE_VERSION }}
104+
59105
- name: Install Task
60106
uses: arduino/setup-task@v1
61107
with:

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

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-npm-task.md
2+
name: Check npm
3+
4+
env:
5+
# See: https://github.com/actions/setup-node/#readme
6+
NODE_VERSION: 16.x
7+
8+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
9+
on:
10+
push:
11+
paths:
12+
- ".github/workflows/check-npm-task.ya?ml"
13+
- "**/package.json"
14+
- "**/package-lock.json"
15+
- "Taskfile.ya?ml"
16+
pull_request:
17+
paths:
18+
- ".github/workflows/check-npm-task.ya?ml"
19+
- "**/package.json"
20+
- "**/package-lock.json"
21+
- "Taskfile.ya?ml"
22+
schedule:
23+
# Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema.
24+
- cron: "0 8 * * TUE"
25+
workflow_dispatch:
26+
repository_dispatch:
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
validate:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: ${{ env.NODE_VERSION }}
43+
44+
- name: Install Task
45+
uses: arduino/setup-task@v1
46+
with:
47+
repo-token: ${{ secrets.GITHUB_TOKEN }}
48+
version: 3.x
49+
50+
- name: Validate package.json
51+
run: task --silent npm:validate
52+
53+
check-sync:
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v3
59+
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v3
62+
with:
63+
node-version: ${{ env.NODE_VERSION }}
64+
65+
- name: Install Task
66+
uses: arduino/setup-task@v1
67+
with:
68+
repo-token: ${{ secrets.GITHUB_TOKEN }}
69+
version: 3.x
70+
71+
- name: Install npm dependencies
72+
run: task npm:install-deps
73+
74+
- name: Check package-lock.json
75+
run: git diff --color --exit-code package-lock.json

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

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
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:
610
push:
711
paths:
@@ -195,6 +199,9 @@ on:
195199
- "**.rviz"
196200
- "**.sublime-syntax"
197201
- "**.syntax"
202+
schedule:
203+
# Run periodically to catch breakage caused by external changes.
204+
- cron: "0 4 * * WED"
198205
workflow_dispatch:
199206
repository_dispatch:
200207

@@ -206,6 +213,11 @@ jobs:
206213
- name: Checkout repository
207214
uses: actions/checkout@v3
208215

216+
- name: Setup Node.js
217+
uses: actions/setup-node@v3
218+
with:
219+
node-version: ${{ env.NODE_VERSION }}
220+
209221
- name: Install Task
210222
uses: arduino/setup-task@v1
211223
with:

0 commit comments

Comments
 (0)