Skip to content

Commit

Permalink
Tools: Use the shared actions for consistency between projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Feb 29, 2024
1 parent ebd76b2 commit cf2456e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 34 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0

- name: Install NodeJS
uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install all dependencies
run: |
composer install
yarn
ref: trunk

- name: Build
run: yarn workspaces run build
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Add the built theme files
run: |
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Install NodeJS
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
node-version-file: '.nvmrc'
cache: yarn
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies & setup configs
run: |
yarn setup:tools
- name: Lint
uses: WordPress/wporg-repo-tools/.github/actions/lint@trunk

- name: Lint CSS
run: |
yarn workspaces run lint:css
- name: Lint JS
run: |
yarn workspaces run lint:js
- name: Lint PHP
run: |
# Eventually add source/wp-content/plugins/support-helphub
composer run lint source/wp-content/themes/wporg-documentation-2022 source/wp-content/mu-plugins/site-documentation.php env
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"start:theme": "yarn workspace wporg-docs-2022-theme start",
"lighthouse": "lighthouse-ci http://localhost:8888/ --accessibility=100 --best-practices=100 --seo=100",
"lighthouse:desktop": "lighthouse http://localhost:8888/ --view --preset=desktop --output-path=lighthouse.html",
"lighthouse:mobile": "lighthouse http://localhost:8888/ --view --screenEmulation.mobile --output-path=lighthouse.html"
"lighthouse:mobile": "lighthouse http://localhost:8888/ --view --screenEmulation.mobile --output-path=lighthouse.html",
"lint:php": "composer run lint source/wp-content/themes/wporg-documentation-2022 source/wp-content/mu-plugins/site-documentation.php env"
},
"workspaces": [
"source/wp-content/themes/wporg-documentation-2022"
Expand Down

0 comments on commit cf2456e

Please sign in to comment.