Skip to content

Commit

Permalink
Add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Dec 14, 2023
1 parent 782b13e commit df69108
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint PHP

on:
# Run on pushes to select branches and on all pull requests.
push:
branches:
- master
- develop
- trunk
- 'feature/**'
- 'release/**'
- 'hotfix/[0-9]+.[0-9]+*'
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

name: "Lint: JS"

steps:
- name: Checkout code
uses: actions/checkout@v3

# The lint stage doesn't run the unit tests or use code style, so no need for PHPUnit, WPCS or phpcompatibility.
- name: 'Install NPM packages'
run: npm install
- name: 'Run ESLint'
run: npm run lint:js
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml → .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: Lint PHP

on:
# Run on pushes to select branches and on all pull requests.
Expand Down Expand Up @@ -69,4 +69,4 @@ jobs:
tools: cs2pr

- name: Lint against parse errors
run: composer lint -- --checkstyle | cs2pr
run: composer lint -- --checkstyle | cs2pr
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dev": "npx webpack --watch --mode development",
"dist": "npx webpack --mode production && composer install --no-dev && composer dump-autoload --no-dev -o && wp-scripts plugin-zip && mv accessibility-checker.zip ./dist && composer install",
"lint": "./vendor/bin/phpcs && npm run lint:js",
"lint:php": "./vendor/bin/phpcs",
"lint:js": "wp-scripts lint-js",
"lint:js:fix": "wp-scripts lint-js --fix",
"test:e2e": "npx wp-env clean tests && npx playwright test ./e2e/specs"
Expand Down

0 comments on commit df69108

Please sign in to comment.