Skip to content

Reduce line length to <=120 in YAML files where feasible #301

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 1 commit into from
Dec 20, 2022
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
6 changes: 5 additions & 1 deletion .github/workflows/check-shell-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ jobs:
run: |
cd "${{ env.INSTALL_PATH }}"
tar --extract --file="${{ steps.download.outputs.name }}"
EXTRACTION_FOLDER="$(basename "${{ steps.download.outputs.name }}" "${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}")"
EXTRACTION_FOLDER="$(
basename \
"${{ steps.download.outputs.name }}" \
"${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}"
)"
# Add installation to PATH:
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
echo "${{ env.INSTALL_PATH }}/$EXTRACTION_FOLDER" >> "$GITHUB_PATH"
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/test-install-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ jobs:
runs-on: ubuntu-latest

env:
PROJECT_OWNER_PLACEHOLDER: arduino # Placeholder value of the PROJECT_OWNER variable in the template script
PROJECT_OWNER: arduino # Replacement value used for the tests
PROJECT_NAME_PLACEHOLDER: TODO_PROJECT_NAME # Placeholder value of the PROJECT_NAME variable in the template script
PROJECT_NAME: arduino-lint # Replacement value used for the tests
# Placeholder value of the PROJECT_OWNER variable in the template script
PROJECT_OWNER_PLACEHOLDER: arduino
# Replacement value used for the tests
PROJECT_OWNER: arduino
# Placeholder value of the PROJECT_NAME variable in the template script
PROJECT_NAME_PLACEHOLDER: TODO_PROJECT_NAME
# Replacement value used for the tests
PROJECT_NAME: arduino-lint
SCRIPT_FOLDER: other/installation-script

steps:
Expand Down Expand Up @@ -254,7 +258,8 @@ jobs:
-F \
'${{ env.TOOL_NAME }} was found at ${{ env.FIRST_BINDIR }}/${{ env.TOOL_NAME }}. Please prepend "${{ env.BINDIR }}" to your $PATH'
# ${{ runner.temp }} is a Windows style path on the windows runner, but the script output uses the equivalent POSIX style path.
# ${{ runner.temp }} is a Windows style path on the windows runner, but the script output uses the equivalent
# POSIX style path.
# So a regex is used for the output check on Windows.
- name: Check script output with previous installation in PATH (Windows)
if: runner.os == 'Windows'
Expand Down
13 changes: 9 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ tasks:
cmds:
- |
if ! which clang-format &>/dev/null; then
echo "clang-format not found or not in PATH. Please install: https://github.com/arduino/clang-static-binaries/releases"
echo "clang-format not found or not in PATH."
echo "Please install: https://github.com/arduino/clang-static-binaries/releases"
exit 1
fi
- |
INSTALLED_CLANG_FORMAT_VERSION_ARRAY=($(clang-format --version))
INSTALLED_CLANG_FORMAT_VERSION="${INSTALLED_CLANG_FORMAT_VERSION_ARRAY[${#INSTALLED_CLANG_FORMAT_VERSION_ARRAY[@]}-1]}"
if [[ "$INSTALLED_CLANG_FORMAT_VERSION" != "{{.EXPECTED_CLANG_FORMAT_VERSION}}" ]]; then
echo "Installed version of clang-format $INSTALLED_CLANG_FORMAT_VERSION (at $(which clang-format)) does not match expected {{.EXPECTED_CLANG_FORMAT_VERSION}}"
echo "Installed version of clang-format does not match expected:"
echo "Installed: $INSTALLED_CLANG_FORMAT_VERSION (at $(which clang-format))"
echo "Expected: {{.EXPECTED_CLANG_FORMAT_VERSION}}"
exit 1
fi
Expand Down Expand Up @@ -522,7 +525,8 @@ tasks:
# npx --call uses the native shell, which makes it too difficult to use npx for this application on Windows,
# so the Windows user is required to have markdown-link-check installed and in PATH.
if ! which markdown-link-check &>/dev/null; then
echo "markdown-link-check not found or not in PATH. Please install: https://github.com/tcort/markdown-link-check#readme"
echo "markdown-link-check not found or not in PATH."
echo "Please install: https://github.com/tcort/markdown-link-check#readme"
exit 1
fi
# Default behavior of the task on Windows is to exit the task when the first broken link causes a non-zero
Expand Down Expand Up @@ -723,7 +727,8 @@ tasks:
cmds:
- |
if ! which shellcheck &>/dev/null; then
echo "shellcheck not installed or not in PATH. Please install: https://github.com/koalaman/shellcheck#installing"
echo "shellcheck not installed or not in PATH."
echo "Please install: https://github.com/koalaman/shellcheck#installing"
exit 1
fi
- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ tasks:
echo "Licensed does not have Windows support."
echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact."
else
echo "licensed not found or not in PATH. Please install: https://github.com/github/licensed#as-an-executable"
echo "licensed not found or not in PATH."
echo "Please install: https://github.com/github/licensed#as-an-executable"
fi
exit 1
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ tasks:
cmds:
- |
if ! which ec &>/dev/null; then
echo "ec not found or not in PATH. Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation"
echo "ec not found or not in PATH."
echo "Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation"
exit 1
fi
- ec
3 changes: 2 additions & 1 deletion workflow-templates/assets/check-markdown-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ tasks:
# npx --call uses the native shell, which makes it too difficult to use npx for this application on Windows,
# so the Windows user is required to have markdown-link-check installed and in PATH.
if ! which markdown-link-check &>/dev/null; then
echo "markdown-link-check not found or not in PATH. Please install: https://github.com/tcort/markdown-link-check#readme"
echo "markdown-link-check not found or not in PATH."
echo "Please install: https://github.com/tcort/markdown-link-check#readme"
exit 1
fi
# Default behavior of the task on Windows is to exit the task when the first broken link causes a non-zero
Expand Down
3 changes: 2 additions & 1 deletion workflow-templates/assets/check-shell-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ tasks:
cmds:
- |
if ! which shellcheck &>/dev/null; then
echo "shellcheck not installed or not in PATH. Please install: https://github.com/koalaman/shellcheck#installing"
echo "shellcheck not installed or not in PATH."
echo "Please install: https://github.com/koalaman/shellcheck#installing"
exit 1
fi
- |
Expand Down
6 changes: 5 additions & 1 deletion workflow-templates/assets/go-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ vars:
DEFAULT_GO_MODULE_PATH: ./
DEFAULT_GO_PACKAGES:
sh: |
echo $(cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')
echo $(
cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} &&
go list ./... | tr '\n' ' ' ||
echo '"ERROR: Unable to discover Go packages"'
)
# `-ldflags` flag to use for `go build` command
# TODO: define flag if required by the project, or leave empty if not needed.
LDFLAGS:
Expand Down
6 changes: 5 additions & 1 deletion workflow-templates/check-shell-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ jobs:
run: |
cd "${{ env.INSTALL_PATH }}"
tar --extract --file="${{ steps.download.outputs.name }}"
EXTRACTION_FOLDER="$(basename "${{ steps.download.outputs.name }}" "${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}")"
EXTRACTION_FOLDER="$(
basename \
"${{ steps.download.outputs.name }}" \
"${{ env.SHELLCHECK_RELEASE_ASSET_SUFFIX }}"
)"
# Add installation to PATH:
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
echo "${{ env.INSTALL_PATH }}/$EXTRACTION_FOLDER" >> "$GITHUB_PATH"
Expand Down
15 changes: 13 additions & 2 deletions workflow-templates/deploy-cobra-mkdocs-versioned-poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ jobs:
id: determination
run: |
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then
if [[
"${{ github.event_name }}" == "push" ||
(
"${{ github.event_name }}" == "create" &&
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
)
]]; then
RESULT="true"
else
RESULT="false"
Expand Down Expand Up @@ -85,7 +91,12 @@ jobs:
# Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits.
git config --global user.email "[email protected]"
git config --global user.name "ArduinoBot"
git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages
git fetch \
--no-tags \
--prune \
--depth=1 \
origin \
+refs/heads/gh-pages:refs/remotes/origin/gh-pages
poetry run mike deploy \
--update-aliases \
--push \
Expand Down
15 changes: 13 additions & 2 deletions workflow-templates/deploy-mkdocs-versioned-poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ jobs:
id: determination
run: |
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then
if [[
"${{ github.event_name }}" == "push" ||
(
"${{ github.event_name }}" == "create" &&
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
)
]]; then
RESULT="true"
else
RESULT="false"
Expand Down Expand Up @@ -71,7 +77,12 @@ jobs:
# Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits.
git config --global user.email "[email protected]"
git config --global user.name "ArduinoBot"
git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages
git fetch \
--no-tags \
--prune \
--depth=1 \
origin \
+refs/heads/gh-pages:refs/remotes/origin/gh-pages
poetry run mike deploy \
--update-aliases \
--push \
Expand Down
3 changes: 2 additions & 1 deletion workflow-templates/publish-go-nightly-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ jobs:
env:
KEYCHAIN: "sign.keychain"
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
# Arbitrary password for a keychain that exists only for the duration of the job, so not secret
KEYCHAIN_PASSWORD: keychainpassword
run: |
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}"
security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}"
Expand Down
10 changes: 8 additions & 2 deletions workflow-templates/release-go-crosscompile-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ jobs:
env:
KEYCHAIN: "sign.keychain"
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
# Arbitrary password for a keychain that exists only for the duration of the job, so not secret
KEYCHAIN_PASSWORD: keychainpassword
run: |
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}"
security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}"
Expand Down Expand Up @@ -180,7 +181,12 @@ jobs:

- name: Update checksum
run: |
declare -a checksum_lines=("${{ needs.notarize-macos.outputs.checksum-darwin_amd64 }}" "${{ needs.notarize-macos.outputs.checksum-darwin_arm64 }}")
declare \
-a \
checksum_lines=(
"${{ needs.notarize-macos.outputs.checksum-darwin_amd64 }}" \
"${{ needs.notarize-macos.outputs.checksum-darwin_arm64 }}"
)
for checksum_line in "${checksum_lines[@]}"
do
CHECKSUM=$(echo ${checksum_line} | cut -d " " -f 1)
Expand Down
12 changes: 10 additions & 2 deletions workflow-templates/release-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ jobs:
env:
KEYCHAIN: "sign.keychain"
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
KEYCHAIN_PASSWORD: keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
# Arbitrary password for a keychain that exists only for the duration of the job, so not secret
KEYCHAIN_PASSWORD: keychainpassword
run: |
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}"
security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}"
Expand Down Expand Up @@ -193,7 +194,14 @@ jobs:
run: |
wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip
unzip -p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver >/tmp/semver && chmod +x /tmp/semver
if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi
if [[
"$(
/tmp/semver get prerel \
"${GITHUB_REF/refs\/tags\//}"
)"
]]; then
echo "IS_PRE=true" >> $GITHUB_OUTPUT
fi

- name: Create Github Release and upload artifacts
uses: ncipollo/release-action@v1
Expand Down
9 changes: 8 additions & 1 deletion workflow-templates/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ jobs:
- name: Identify Prerelease
id: prerelease
run: |
if [[ "$("${{ env.SEMVER_TOOL_PATH }}" get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT"; fi
if [[
"$(
"${{ env.SEMVER_TOOL_PATH }}" get prerel \
"${GITHUB_REF/refs\/tags\//}"
)"
]]; then
echo "IS_PRE=true" >> $GITHUB_OUTPUT"
fi
- name: Create Github release
uses: ncipollo/release-action@v1
Expand Down