From 104b557b9879c87c9b43197846f40e1f1f9405a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Sat, 12 Nov 2022 18:27:01 -0300 Subject: Add Actions workflow for JS/CSS lint and test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- .github/workflows/frontend-tests.yml | 76 ++++++++++++++++++++++++++++++ .github/workflows/lint-and-analyse-php.yml | 21 --------- .github/workflows/tests.yml | 19 -------- 3 files changed, 76 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/frontend-tests.yml 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 -- cgit v1.2.3