diff options
author | MaurĂcio Meneghini Fauth <mauricio@fauth.dev> | 2022-11-13 18:39:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-13 18:39:13 +0300 |
commit | 5bb6b42868281c3039ad24a6de9bdd4a4d9cd28a (patch) | |
tree | 213a7f349f5e780cd7943060bcc665351e8a23fe | |
parent | 39c0b069dd1b47b555547e7281e9149fab784bbd (diff) | |
parent | 104b557b9879c87c9b43197846f40e1f1f9405a7 (diff) |
Merge pull request #17891 from MauricioFauth/frontend-workflow
Add Actions workflow for JS/CSS lint and test
-rw-r--r-- | .github/workflows/frontend-tests.yml | 76 | ||||
-rw-r--r-- | .github/workflows/lint-and-analyse-php.yml | 21 | ||||
-rw-r--r-- | .github/workflows/tests.yml | 19 |
3 files changed, 76 insertions, 40 deletions
diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml new file mode 100644 index 0000000000..34cc39d6bd --- /dev/null +++ b/.github/workflows/frontend-tests.yml @@ -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 diff --git a/.github/workflows/lint-and-analyse-php.yml b/.github/workflows/lint-and-analyse-php.yml index 1b292d5f37..377e703953 100644 --- a/.github/workflows/lint-and-analyse-php.yml +++ b/.github/workflows/lint-and-analyse-php.yml @@ -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: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b6b1080915..22eda63abf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 |