Skip to content

Commit

Permalink
Tools: Use shared build action
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Dec 18, 2024
1 parent 2cda74f commit b497eef
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 123 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-blocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ jobs:
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
packageManager: "npm"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Remove build artifacts
run: |
rm -rf public_html/wp-content/themes/wporg-pattern-directory-2024/node_modules
rm -rf public_html/wp-content/plugins/pattern-creator/node_modules
rm -rf public_html/wp-content/plugins/pattern-directory/node_modules
- name: Ignore .gitignore
run: |
git add public_html/wp-content/themes/wporg-pattern-directory-2024/* --force
git add public_html/wp-content/plugins/pattern-*/build --force
- name: Append build number to version
run: |
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/build.yml

This file was deleted.

33 changes: 6 additions & 27 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
node-version-file: '.nvmrc'
cache: npm
packageManager: "npm"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install JS dependencies
run: |
npm install
- name: Set PHP version
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
with:
php-version: 7.4
coverage: none
tools: composer:v2

- name: Install PHP dependencies
run: |
composer install
- name: Lint JavaScript and Styles
run: |
npm run lint:js --workspaces -- --quiet
npm run lint:css --workspaces
- name: Lint PHP
run: |
composer run lint
- name: Lint
uses: WordPress/wporg-repo-tools/.github/actions/lint@trunk
52 changes: 8 additions & 44 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Set PHP version
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
php-version: 7.4
coverage: none
tools: composer:v2

- name: Install PHP dependencies
run: |
composer install
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install JS dependencies
run: |
npm install
- name: Build
run: npm run build --workspaces
packageManager: "npm"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install WordPress
run: |
Expand All @@ -66,29 +48,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
- name: Setup
uses: WordPress/wporg-repo-tools/.github/actions/setup@trunk
with:
node-version-file: '.nvmrc'
cache: npm

- name: Set PHP version
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
with:
php-version: 7.4
coverage: none
tools: composer:v2

- name: Install PHP dependencies
run: |
composer install
- name: Install JS dependencies
run: |
npm
- name: Build
run: npm run build --workspaces
packageManager: "npm"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run unit tests on theme data store
run: npm run test:unit --workspace=wporg-pattern-directory-theme
Expand Down

0 comments on commit b497eef

Please sign in to comment.