From 71be0f9743fb514e1cf74e4ab6eff8d1d7e38bca Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Fri, 2 Dec 2022 15:09:31 +0000 Subject: [PATCH] Move JavaScript linting to GitHub workflows --- .circleci/config.yml | 22 --------------------- .github/workflows/js_lint.yaml | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/js_lint.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index de8fab93353..c3a75d00f84 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,16 +5,6 @@ variables: restore_cache: keys: - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - restore_yarn_cache: &restore_yarn_cache - restore_cache: - keys: - - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - - yarn-packages-{{ checksum "client/yarn.lock" }} - save_yarn_cache: &save_yarn_cache - save_cache: - key: yarn-packages-{{ checksum "client/yarn.lock" }} - paths: - - ~/.cache/yarn install_tox: &install_tox run: pip install tox set_workdir: &set_workdir @@ -91,16 +81,6 @@ jobs: - run: sudo apt-get install -y libxml2-utils - *install_tox - run: tox -e validate_test_tools - js_lint: - docker: - - image: cimg/node:16.15.1 - <<: *set_workdir - steps: - - *restore_yarn_cache - - run: cd client && yarn install --frozen-lockfile - - *save_yarn_cache - - run: cd client && yarn run eslint - - run: cd client && yarn run format-check workflows: version: 2 get_code_and_test: @@ -108,5 +88,3 @@ workflows: - get_code - validate_test_tools: <<: *requires_get_code - - js_lint: - <<: *requires_get_code diff --git a/.github/workflows/js_lint.yaml b/.github/workflows/js_lint.yaml new file mode 100644 index 00000000000..a59da3aa4ad --- /dev/null +++ b/.github/workflows/js_lint.yaml @@ -0,0 +1,35 @@ +name: Client linting +on: + push: + paths: + - 'client/**' + - '.github/workflows/js_lint.yaml' + pull_request: + paths: + - 'client/**' + - '.github/workflows/js_lint.yaml' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + client-unit-test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [16] + steps: + - uses: actions/checkout@v3 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node}} + cache: 'yarn' + cache-dependency-path: 'client/yarn.lock' + - run: yarn install --frozen-lockfile + working-directory: client + - name: Run ESLint + run: yarn run eslint + working-directory: client + - name: Run prettier checks + run: yarn run format-check + working-directory: client