Skip to content

Set up automated Library Manager submission system #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/.markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"retryOn429": true,
"retryCount": 3,
"aliveStatusCodes": [200, 206]
}
61 changes: 61 additions & 0 deletions .github/.markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# See: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
# The code style defined in this file is the official standardized style to be used in all Arduino projects and should
# not be modified.
# Note: Rules disabled solely because they are redundant to Prettier are marked with a "Prettier" comment.

default: false
MD001: false
MD002: false
MD003: false # Prettier
MD004: false # Prettier
MD005: false # Prettier
MD006: false # Prettier
MD007: false # Prettier
MD008: false # Prettier
MD009:
br_spaces: 0
strict: true
list_item_empty_lines: false # Prettier
MD010: false # Prettier
MD011: true
MD012: false # Prettier
MD013: false
MD014: false
MD018: true
MD019: false # Prettier
MD020: true
MD021: false # Prettier
MD022: false # Prettier
MD023: false # Prettier
MD024: false
MD025:
level: 1
front_matter_title: '^\s*"?title"?\s*[:=]'
MD026: false
MD027: false # Prettier
MD028: false
MD029:
style: one
MD030:
ul_single: 1
ol_single: 1
ul_multi: 1
ol_multi: 1
MD031: false # Prettier
MD032: false # Prettier
MD033: false
MD034: false
MD035: false # Prettier
MD036: false
MD037: true
MD038: true
MD039: true
MD040: false
MD041: false
MD042: true
MD043: false
MD044: false
MD045: true
MD046:
style: fenced
MD047: false # Prettier
60 changes: 60 additions & 0 deletions .github/workflows/check-license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Check license

env:
EXPECTED_LICENSE_FILENAME: LICENSE.txt
# SPDX identifier: https://spdx.org/licenses/
EXPECTED_LICENSE_TYPE: CC0-1.0

on:
push:
paths:
- ".github/workflows/check-license.yml"
# Recognized license files. See: https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md#detecting-the-license-file
- "[cC][oO][pP][yY][iI][nN][gG]*"
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
- "[oO][fF][lL]*"
- "[pP][aA][tT][eE][nN][tT][sS]*"
pull_request:
paths:
- ".github/workflows/check-license.yml"
- "[cC][oO][pP][yY][iI][nN][gG]*"
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
- "[oO][fF][lL]*"
- "[pP][aA][tT][eE][nN][tT][sS]*"

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout local repository
uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby # Install latest version

- name: Install licensee
run: gem install licensee

# See: https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/licensing-a-repository
- name: Check license file
run: |
# See: https://github.com/licensee/licensee
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"

DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
echo "Detected license file: $DETECTED_LICENSE_FILE"
if [ "$DETECTED_LICENSE_FILE" != "\"$EXPECTED_LICENSE_FILENAME\"" ]; then
echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME"
exit 1
fi

DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
echo "Detected license type: $DETECTED_LICENSE_TYPE"
if [ "$DETECTED_LICENSE_TYPE" != "\"$EXPECTED_LICENSE_TYPE\"" ]; then
echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE"
exit 1
fi
67 changes: 67 additions & 0 deletions .github/workflows/check-markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Check Markdown

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-markdown.yml"
- ".github/.markdown-link-check.json"
- "**/.markdownlint*"
- "**.md"
- "**.mdx"
- "**.mkdn"
- "**.mdown"
- "**.markdown"
pull_request:
paths:
- ".github/workflows/check-markdown.yml"
- ".github/.markdown-link-check.json"
- "**/.markdownlint*"
- "**.md"
- "**.mdx"
- "**.mkdn"
- "**.mdown"
- "**.markdown"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to markdownlint.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize markdownlint-cli problem matcher
uses: xt0rted/markdownlint-problem-matcher@v1

- name: Install markdownlint-cli
run: sudo npm install --global markdownlint-cli

- name: Run markdownlint
run: markdownlint --config "${{ github.workspace }}/.github/.markdownlint.yml" "**/*.md"

links:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Determine whether only modified files should be checked
id: check-modified
if: github.event_name == 'pull_request'
run: |
echo "::set-output name=value::yes"

- name: Check links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: .github/.markdown-link-check.json
use-quiet-mode: "yes"
check-modified-files-only: ${{ steps.check-modified.outputs.value }}
base-branch: ${{ github.base_ref }}
Loading