Merge pull request #17891 from MauricioFauth/frontend-workflow

Add Actions workflow for JS/CSS lint and test
This commit is contained in:
Maurício Meneghini Fauth 2022-11-13 12:39:13 -03:00 committed by GitHub
commit 5bb6b42868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 76 additions and 40 deletions

76
.github/workflows/frontend-tests.yml vendored Normal file
View File

@ -0,0 +1,76 @@
name: Frontend analysis and tests
on:
push:
pull_request:
paths:
- 'js/**'
- '**.s?css'
- 'test/javascript/**'
- '.browserslistrc'
- '.eslint*'
- '*.cjs'
- 'package.json'
- 'tsconfig.json'
- 'yarn.lock'
permissions:
contents: read
jobs:
javascript-test:
name: Test JavaScript files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Run tests
run: yarn test
javascript-lint:
name: Lint JavaScript files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Lint JavaScript files
run: yarn run js-lint --quiet
css-lint:
name: Lint CSS files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Lint CSS files
run: yarn run css-lint

View File

@ -12,27 +12,6 @@ permissions:
contents: read
jobs:
lint-node:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Lint JavaScript files
run: yarn run js-lint --quiet
- name: Lint CSS files
run: yarn run css-lint
lint-php-files:
runs-on: ubuntu-latest
strategy:

View File

@ -189,22 +189,3 @@ jobs:
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: build/logs/clover.xml
test-js:
name: Test javascript files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Run tests
run: yarn test