Skip to content

Commit d66854b

Browse files
authored
Merge pull request #627 from PHPCSStandards/feature/ghactions-use-reusable-workflows
GH Actions/Basics: use reusable workflow
2 parents 5ce89da + 3ba2f68 commit d66854b

File tree

1 file changed

+6
-108
lines changed

1 file changed

+6
-108
lines changed

.github/workflows/basics.yml

Lines changed: 6 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -90,120 +90,18 @@ jobs:
9090

9191
phpstan:
9292
name: "PHPStan"
93-
runs-on: "ubuntu-latest"
94-
95-
steps:
96-
- name: Checkout code
97-
uses: actions/checkout@v4
98-
99-
- name: Install PHP
100-
uses: shivammathur/setup-php@v2
101-
with:
102-
php-version: 'latest'
103-
coverage: none
104-
tools: phpstan
105-
106-
# Install dependencies and handle caching in one go.
107-
# Dependencies need to be installed to make sure the PHPCS and PHPUnit classes are recognized.
108-
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
109-
- name: Install Composer dependencies
110-
uses: "ramsey/composer-install@v3"
111-
with:
112-
# Bust the cache at least once a month - output format: YYYY-MM.
113-
custom-cache-suffix: $(date -u "+%Y-%m")
114-
115-
- name: Run PHPStan
116-
run: phpstan analyse
93+
uses: PHPCSStandards/.github/.github/workflows/reusable-phpstan.yml@main
11794

11895
markdownlint:
11996
name: 'Lint Markdown'
120-
runs-on: ubuntu-latest
121-
122-
steps:
123-
- name: Checkout code
124-
uses: actions/checkout@v4
125-
126-
# @link https://github.com/marketplace/actions/problem-matcher-for-markdownlint-cli
127-
- name: Enable showing issue in PRs
128-
uses: xt0rted/markdownlint-problem-matcher@v3
129-
130-
# @link https://github.com/marketplace/actions/markdownlint-cli2-action
131-
- name: Check markdown with CLI2
132-
uses: DavidAnson/markdownlint-cli2-action@v17
97+
uses: PHPCSStandards/.github/.github/workflows/reusable-markdownlint.yml@main
13398

13499
remark:
135100
name: 'QA Markdown'
136-
runs-on: ubuntu-latest
137-
138-
steps:
139-
- name: Checkout code
140-
uses: actions/checkout@v4
141-
142-
- name: Set up node and enable caching of dependencies
143-
uses: actions/setup-node@v4
144-
with:
145-
node-version: '16'
146-
147-
# To make the command available on CLI, it needs to be installed globally.
148-
- name: Install Remark CLI globally
149-
run: npm install --global remark-cli --foreground-scripts true --fund false
150-
151-
# To allow for creating a custom config which references rules which are included
152-
# in the presets, without having to install all rules individually, a local install
153-
# works best (and installing the presets in the first place, of course).
154-
#
155-
# Note: the first group of packages are all part of the mono "Remark lint" repo.
156-
# The second group of packages (heading-whitespace and down) are additional
157-
# "external" rules/plugins.
158-
- name: Install Remark rules locally
159-
run: >
160-
npm install --foreground-scripts true --fund false
161-
remark-lint
162-
remark-gfm
163-
remark-preset-lint-consistent
164-
remark-preset-lint-recommended
165-
remark-preset-lint-markdown-style-guide
166-
remark-lint-checkbox-content-indent
167-
remark-lint-linebreak-style
168-
remark-lint-no-dead-urls
169-
remark-lint-no-duplicate-defined-urls
170-
remark-lint-no-empty-url
171-
remark-lint-no-heading-like-paragraph
172-
remark-lint-no-reference-like-url
173-
remark-lint-no-unneeded-full-reference-image
174-
remark-lint-no-unneeded-full-reference-link
175-
remark-lint-strikethrough-marker
176-
remark-lint-heading-whitespace
177-
remark-lint-list-item-punctuation
178-
remark-lint-match-punctuation
179-
remark-lint-no-hr-after-heading
180-
remark-lint-are-links-valid-duplicate
181-
remark-validate-links
182-
183-
- name: Run Remark-lint
184-
run: remark . --frail
185-
186-
# @link https://github.com/reviewdog/action-remark-lint
187-
- name: Show Remark-lint annotations in PR
188-
if: ${{ failure() && github.event_name == 'pull_request' }}
189-
uses: reviewdog/action-remark-lint@v5
190-
with:
191-
fail_on_error: true
192-
install_deps: false
193-
level: info
194-
reporter: github-pr-check
101+
uses: PHPCSStandards/.github/.github/workflows/reusable-remark.yml@main
195102

196103
yamllint:
197104
name: 'Lint Yaml'
198-
runs-on: ubuntu-latest
199-
200-
steps:
201-
- name: Checkout code
202-
uses: actions/checkout@v4
203-
204-
- name: Run Yamllint on all yaml files in repo
205-
run: yamllint . --format colored --strict
206-
207-
- name: Pipe Yamllint results on to GH for inline display
208-
if: ${{ failure() }}
209-
run: yamllint . --format github --strict
105+
uses: PHPCSStandards/.github/.github/workflows/reusable-yamllint.yml@main
106+
with:
107+
strict: true

0 commit comments

Comments
 (0)