From cf2456e11e13245a3357b082c3a25d1df9c3df27 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Thu, 29 Feb 2024 16:14:16 -0500 Subject: [PATCH] Tools: Use the shared actions for consistency between projects --- .github/workflows/build.yml | 19 ++++++------------- .github/workflows/linters.yml | 26 ++++++-------------------- package.json | 3 ++- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd55d61..4528e69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: | diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index d0d9b9f..c96a97c 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -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 diff --git a/package.json b/package.json index 6d0e0d8..c389c25 100644 --- a/package.json +++ b/package.json @@ -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"