Skip to content

Commit c2fd5e2

Browse files
authored
Merge pull request #1 from per1234/development
Set up automated Library Manager submission system
2 parents 6d2f53d + 7947b23 commit c2fd5e2

10 files changed

+4608
-0
lines changed

.github/.markdown-link-check.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"retryOn429": true,
3+
"retryCount": 3,
4+
"aliveStatusCodes": [200, 206]
5+
}

.github/.markdownlint.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# See: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
2+
# The code style defined in this file is the official standardized style to be used in all Arduino projects and should
3+
# not be modified.
4+
# Note: Rules disabled solely because they are redundant to Prettier are marked with a "Prettier" comment.
5+
6+
default: false
7+
MD001: false
8+
MD002: false
9+
MD003: false # Prettier
10+
MD004: false # Prettier
11+
MD005: false # Prettier
12+
MD006: false # Prettier
13+
MD007: false # Prettier
14+
MD008: false # Prettier
15+
MD009:
16+
br_spaces: 0
17+
strict: true
18+
list_item_empty_lines: false # Prettier
19+
MD010: false # Prettier
20+
MD011: true
21+
MD012: false # Prettier
22+
MD013: false
23+
MD014: false
24+
MD018: true
25+
MD019: false # Prettier
26+
MD020: true
27+
MD021: false # Prettier
28+
MD022: false # Prettier
29+
MD023: false # Prettier
30+
MD024: false
31+
MD025:
32+
level: 1
33+
front_matter_title: '^\s*"?title"?\s*[:=]'
34+
MD026: false
35+
MD027: false # Prettier
36+
MD028: false
37+
MD029:
38+
style: one
39+
MD030:
40+
ul_single: 1
41+
ol_single: 1
42+
ul_multi: 1
43+
ol_multi: 1
44+
MD031: false # Prettier
45+
MD032: false # Prettier
46+
MD033: false
47+
MD034: false
48+
MD035: false # Prettier
49+
MD036: false
50+
MD037: true
51+
MD038: true
52+
MD039: true
53+
MD040: false
54+
MD041: false
55+
MD042: true
56+
MD043: false
57+
MD044: false
58+
MD045: true
59+
MD046:
60+
style: fenced
61+
MD047: false # Prettier

.github/workflows/check-license.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Check license
2+
3+
env:
4+
EXPECTED_LICENSE_FILENAME: LICENSE.txt
5+
# SPDX identifier: https://spdx.org/licenses/
6+
EXPECTED_LICENSE_TYPE: CC0-1.0
7+
8+
on:
9+
push:
10+
paths:
11+
- ".github/workflows/check-license.yml"
12+
# Recognized license files. See: https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md#detecting-the-license-file
13+
- "[cC][oO][pP][yY][iI][nN][gG]*"
14+
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
15+
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
16+
- "[oO][fF][lL]*"
17+
- "[pP][aA][tT][eE][nN][tT][sS]*"
18+
pull_request:
19+
paths:
20+
- ".github/workflows/check-license.yml"
21+
- "[cC][oO][pP][yY][iI][nN][gG]*"
22+
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
23+
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
24+
- "[oO][fF][lL]*"
25+
- "[pP][aA][tT][eE][nN][tT][sS]*"
26+
27+
jobs:
28+
check:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout local repository
33+
uses: actions/checkout@v2
34+
35+
- uses: ruby/setup-ruby@v1
36+
with:
37+
ruby-version: ruby # Install latest version
38+
39+
- name: Install licensee
40+
run: gem install licensee
41+
42+
# See: https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/licensing-a-repository
43+
- name: Check license file
44+
run: |
45+
# See: https://github.com/licensee/licensee
46+
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"
47+
48+
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
49+
echo "Detected license file: $DETECTED_LICENSE_FILE"
50+
if [ "$DETECTED_LICENSE_FILE" != "\"$EXPECTED_LICENSE_FILENAME\"" ]; then
51+
echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME"
52+
exit 1
53+
fi
54+
55+
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
56+
echo "Detected license type: $DETECTED_LICENSE_TYPE"
57+
if [ "$DETECTED_LICENSE_TYPE" != "\"$EXPECTED_LICENSE_TYPE\"" ]; then
58+
echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE"
59+
exit 1
60+
fi

.github/workflows/check-markdown.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Check Markdown
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
paths:
7+
- ".github/workflows/check-markdown.yml"
8+
- ".github/.markdown-link-check.json"
9+
- "**/.markdownlint*"
10+
- "**.md"
11+
- "**.mdx"
12+
- "**.mkdn"
13+
- "**.mdown"
14+
- "**.markdown"
15+
pull_request:
16+
paths:
17+
- ".github/workflows/check-markdown.yml"
18+
- ".github/.markdown-link-check.json"
19+
- "**/.markdownlint*"
20+
- "**.md"
21+
- "**.mdx"
22+
- "**.mkdn"
23+
- "**.mdown"
24+
- "**.markdown"
25+
schedule:
26+
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to markdownlint.
27+
- cron: "0 8 * * TUE"
28+
workflow_dispatch:
29+
repository_dispatch:
30+
31+
jobs:
32+
lint:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v2
38+
39+
- name: Initialize markdownlint-cli problem matcher
40+
uses: xt0rted/markdownlint-problem-matcher@v1
41+
42+
- name: Install markdownlint-cli
43+
run: sudo npm install --global markdownlint-cli
44+
45+
- name: Run markdownlint
46+
run: markdownlint --config "${{ github.workspace }}/.github/.markdownlint.yml" "**/*.md"
47+
48+
links:
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v2
54+
55+
- name: Determine whether only modified files should be checked
56+
id: check-modified
57+
if: github.event_name == 'pull_request'
58+
run: |
59+
echo "::set-output name=value::yes"
60+
61+
- name: Check links
62+
uses: gaurav-nelson/github-action-markdown-link-check@v1
63+
with:
64+
config-file: .github/.markdown-link-check.json
65+
use-quiet-mode: "yes"
66+
check-modified-files-only: ${{ steps.check-modified.outputs.value }}
67+
base-branch: ${{ github.base_ref }}

0 commit comments

Comments
 (0)