-
Notifications
You must be signed in to change notification settings - Fork 1
Added GitHub Actions templates and tool configuration files #104
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
Open
rimi-itk
wants to merge
26
commits into
develop
Choose a base branch
from
feature/github-actions-templates
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0d04d02
Added GitHub Actions templates and tool configuration files
rimi-itk fd81234
Taking own medicine
rimi-itk 5a1752c
Update github/workflows/composer.yaml
rimi-itk 6366b2e
Update github/workflows/drupal.yaml
rimi-itk f67e9ae
Update config/markdownlint-cli/.markdownlintignore
rimi-itk 32774ad
Update github/workflows/composer.yaml
rimi-itk 678951b
Updated generated documentation
rimi-itk a42cb1f
Added and checked file headers
rimi-itk ef8d484
Updated Markdown actions
rimi-itk 8bc03ac
Run docker image as appropriate user
rimi-itk 9f892de
Cleaned up and improved
rimi-itk 83a9b6e
More clean up
rimi-itk cc5a513
Added config file headers
rimi-itk c07e6bb
Cleaned up tasks and shell scripts
rimi-itk c601873
Updated GitHub Actions template documentation
rimi-itk 6610aee
More documentation and cleanup
rimi-itk 7996f37
Added branches to on.push event
rimi-itk fb1efe1
Added Drupal styles workflow
rimi-itk 2281239
Checked YAML files
rimi-itk f23708d
Cleaned up
rimi-itk 12386c3
Updated workflow files
rimi-itk e0589c1
Added Drupal JavaScript workflow
rimi-itk c01409a
Updated links
rimi-itk 1093f59
Added shellckeck to workflo
rimi-itk 917b114
Updated Markdownlint ignores
rimi-itk b53a8fc
Run markdownlint via docker compose
rimi-itk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
on: pull_request | ||
|
||
name: Review | ||
|
||
env: | ||
COMPOSE_USER: runner | ||
|
||
jobs: | ||
check-github-actions-documentation: | ||
runs-on: ubuntu-latest | ||
name: Check that Github Actions documentation is up to date | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: arduino/setup-task@v2 | ||
# https://github.com/arduino/setup-task/tree/56d0cc033e3cecc5f07a291fdd39f29388d21800?tab=readme-ov-file#repo-token | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# https://github.com/mxschmitt/action-tmate?tab=readme-ov-file#manually-triggered-debug | ||
# Enable tmate debugging if debug logging is enabled (cf. | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context) | ||
- name: Setup tmate session | ||
uses: mxschmitt/action-tmate@v3 | ||
if: 1 == runner.debug | ||
|
||
- run: | | ||
task github-actions:documentation:update | ||
|
||
# Check that documentation has not changed. | ||
- run: | | ||
task github-actions:documentation:diff | ||
|
||
check-github-actions-template-headers: | ||
runs-on: ubuntu-latest | ||
name: Check that Github Actions template headers are up to date | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: arduino/setup-task@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
task github-actions:template-headers:update --yes | ||
# Check that files have not changed. | ||
- run: | | ||
git diff --exit-code | ||
|
||
check-config-file-headers: | ||
runs-on: ubuntu-latest | ||
name: Check that config file headers are up to date | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: arduino/setup-task@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
task github-actions:config-headers:update --yes | ||
# Check that files have not changed. | ||
- run: | | ||
git diff --exit-code | ||
|
||
check-links: | ||
runs-on: ubuntu-latest | ||
name: Check that workflow and config file links are up to date | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: arduino/setup-task@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
task github-actions:link --yes | ||
# Check that files have not changed. | ||
- run: | | ||
git diff --exit-code | ||
|
||
lint-markdown: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: arduino/setup-task@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
SKIP_FIX=1 task lint:markdown | ||
|
||
lint-shell-script: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: arduino/setup-task@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
SKIP_FIX=1 task lint:shell-script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Do not edit this file! Make a pull request on changing | ||
# github/workflows/markdown.yaml in | ||
# https://github.com/itk-dev/devops_itkdev-docker if need be. | ||
|
||
### ## Markdown | ||
### | ||
### Uses [itkdev/markdownlint](https://hub.docker.com/r/itkdev/markdownlint) to | ||
### link all Markdown files (`**/*.md`) in the project. | ||
### | ||
### [markdownlint-cli configuration ### files](https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration), | ||
### `.markdownlint.jsonc` and `.markdownlintignore` control what is actually linted and how. | ||
|
||
name: Markdown | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
markdown-lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- run: | | ||
docker run --rm --volume "$PWD":/md itkdev/markdownlint '**/*.md' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
on: pull_request | ||
|
||
name: Workflow templates | ||
|
||
jobs: | ||
check-yaml: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: | | ||
docker pull mikefarah/yq | ||
for f in $(find github/workflows/ -name '*.yaml'); do | ||
docker run --rm --volume "$PWD":/workdir mikefarah/yq "$f" > /dev/null | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.task |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// markdownlint-cli configuration file (cf. https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration) | ||
{ | ||
"default": true, | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md | ||
"line-length": { | ||
"line_length": 120, | ||
"code_blocks": false, | ||
"tables": false | ||
}, | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md | ||
"no-duplicate-heading": { | ||
"siblings_only": true | ||
}, | ||
// https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections#creating-a-collapsed-section | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md033.md | ||
"no-inline-html": { | ||
"allowed_elements": ["details", "summary"] | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#ignoring-files | ||
vendor/ | ||
node_modules/ | ||
LICENSE.md | ||
# Drupal | ||
web/*.md | ||
web/core/ | ||
web/*/contrib/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# https://taskfile.dev | ||
|
||
version: '3' | ||
|
||
includes: | ||
github-actions: ./task/Taskfile.github-actions.yml | ||
|
||
vars: | ||
GITHUB_ACTIONS_TEMPLATES_HEADER: | | ||
# Github Actions templates | ||
|
||
This repository contains a number of [GitHub | ||
Actions](https://docs.github.com/en/actions) workflow template files that | ||
are copied to a project when running `itkdev-docker-compose | ||
template:install`. Any changes to the workflows should be made in [this | ||
repository](%THIS_REPOSITORY%) and then the project template must be updated | ||
to match the new templates. | ||
|
||
GITHUB_ACTIONS_TEMPLATES_FOOTER: | | ||
|
||
tasks: | ||
build: | ||
desc: "Build everything" | ||
cmds: | ||
- task: github-actions:documentation:update | ||
- task: github-actions:link | ||
- task: lint:markdown | ||
- task: lint:yaml | ||
|
||
lint:markdown: | ||
desc: "Lint Markdown" | ||
cmds: | ||
- '[[ -n "$SKIP_FIX" ]] || docker run --rm --volume "$PWD":/md itkdev/markdownlint markdownlint {{.GLOB}} --fix' | ||
- docker run --rm --volume "$PWD":/md itkdev/markdownlint markdownlint {{.GLOB}} | ||
vars: | ||
# We use a block scalar (https://yaml-multiline.info/#block-scalars) here to make escaping (a little) easier. | ||
GLOB: >- | ||
{{.CLI_ARGS | default "'**/*.md'"}} | ||
|
||
lint:shell-script: | ||
desc: "Lint shell scripts" | ||
cmds: | ||
# https://github.com/koalaman/shellcheck?tab=readme-ov-file#installing | ||
- docker run --rm --volume "$PWD:"/mnt koalaman/shellcheck:stable {{.GLOB}} | ||
vars: | ||
# We use a block scalar (https://yaml-multiline.info/#block-scalars) here to make escaping (a little) easier. | ||
GLOB: >- | ||
{{.CLI_ARGS | default "task/scripts/*"}} | ||
|
||
lint:yaml: | ||
desc: "Lint YAML" | ||
cmds: | ||
- | | ||
# docker pull mikefarah/yq | ||
for f in $(find github/workflows/ -name '*.yaml'); do | ||
docker run --rm --volume "$PWD":/workdir mikefarah/yq "$f" > /dev/null | ||
done | ||
|
||
default: | ||
cmds: | ||
- task --list | ||
silent: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0"?> | ||
<!-- This file is copied from config/drupal/php/.phpcs.xml.dist in https://github.com/itk-dev/devops_itkdev-docker. --> | ||
<!-- Feel free to edit the file, but consider making a pull request if you find a general issue with the file. --> | ||
|
||
<ruleset name="PHP_CodeSniffer"> | ||
<description>The coding standard.</description> | ||
|
||
<file>web/modules/custom/</file> | ||
<file>web/themes/custom/</file> | ||
|
||
<!-- Exclude generated files --> | ||
<exclude-pattern>node_modules</exclude-pattern> | ||
<exclude-pattern>vendor</exclude-pattern> | ||
<exclude-pattern>web/*/custom/*/build/</exclude-pattern> | ||
<exclude-pattern>*.css</exclude-pattern> | ||
<exclude-pattern>*.js</exclude-pattern> | ||
|
||
<arg value="p"/> | ||
|
||
<arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,yml"/> | ||
|
||
<config name="drupal_core_version" value="11"/> | ||
|
||
<rule ref="Drupal"> | ||
<!-- <exclude name="Drupal.Files.TxtFileLineLength.TooLong"/> --> | ||
<!-- We want to be able to use "package" and "version" in our custom modules --> | ||
<exclude name="Drupal.InfoFiles.AutoAddedKeys.Project"/> | ||
<exclude name="Drupal.InfoFiles.AutoAddedKeys.Version"/> | ||
<exclude name="Drupal.NamingConventions.ValidEnumCase.NoUpperAcronyms" /> | ||
<exclude name="Drupal.NamingConventions.ValidEnumCase.NoUnderscores" /> | ||
</rule> | ||
<rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired"/> | ||
</ruleset> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
// This file is copied from config/drupal/twig/.twig-cs-fixer.dist.php in https://github.com/itk-dev/devops_itkdev-docker. | ||
// Feel free to edit the file, but consider making a pull request if you find a general issue with the file. | ||
|
||
// https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/docs/configuration.md#configuration-file | ||
|
||
$finder = new TwigCsFixer\File\Finder(); | ||
// Check all files … | ||
$finder->in(__DIR__); | ||
// … that are not ignored by VCS | ||
$finder->ignoreVCSIgnored(true); | ||
|
||
$config = new TwigCsFixer\Config\Config(); | ||
$config->setFinder($finder); | ||
|
||
return $config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// This file is copied from config/markdown/.markdownlint.jsonc in https://github.com/itk-dev/devops_itkdev-docker. | ||
// Feel free to edit the file, but consider making a pull request if you find a general issue with the file. | ||
|
||
// markdownlint-cli configuration file (cf. https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration) | ||
{ | ||
"default": true, | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md | ||
"line-length": { | ||
"line_length": 120, | ||
"code_blocks": false, | ||
"tables": false | ||
}, | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md | ||
"no-duplicate-heading": { | ||
"siblings_only": true | ||
}, | ||
// https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections#creating-a-collapsed-section | ||
// https://github.com/DavidAnson/markdownlint/blob/main/doc/md033.md | ||
"no-inline-html": { | ||
"allowed_elements": ["details", "summary"] | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file is copied from config/markdown/.markdownlintignore in https://github.com/itk-dev/devops_itkdev-docker. | ||
# Feel free to edit the file, but consider making a pull request if you find a general issue with the file. | ||
|
||
# https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#ignoring-files | ||
vendor/ | ||
node_modules/ | ||
LICENSE.md | ||
# Drupal | ||
web/*.md | ||
web/core/ | ||
web/*/contrib/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about good old
peterdavehello/shellcheck
https://github.com/PeterDaveHello/docker-shellcheckThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://hub.docker.com/r/koalaman/shellcheck “is the official Docker image for ShellCheck”.