From 916ff89f582803facd51207c54282a5a24645ab7 Mon Sep 17 00:00:00 2001 From: Jamie Henson Date: Fri, 15 Mar 2024 12:06:49 +0000 Subject: [PATCH] chore: GH actions test --- .circleci/config.yml | 90 -------------------------------------- .github/workflows/push.yml | 30 +++++++++++++ 2 files changed, 30 insertions(+), 90 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/push.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a13be36d8..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,90 +0,0 @@ -version: 2.1 - -orbs: - browser-tools: circleci/browser-tools@1.4.4 - node: circleci/node@5.1.0 - cypress: cypress-io/cypress@3 - -caches: - - &yarn_cache ably-ui-preview-yarn-v1-{{ checksum "yarn.lock" }} - -executors: - default: - parameters: - tag: - description: The circleci/ruby Docker image version tag - type: string - default: latest - docker: - - image: cimg/node:16.17.0-browsers - environment: - - NODE_VERSION: 16.17.0 - - YARN_VERSION: 1.22.10 - -commands: - install_browser: - description: Install browser - steps: - - browser-tools/install-chrome - save_yarn_cache: - description: Save yarn cache - steps: - - save_cache: - key: *yarn_cache - paths: - - node_modules - - ~/.cache - restore_yarn_cache: - description: Restore yarn cache - steps: - - restore_cache: - keys: - - *yarn_cache - yarn_install: - description: Install javascript packages - steps: - - restore_yarn_cache - - run: yarn --frozen-lockfile - - save_yarn_cache - lint: - description: Run eslint on library - steps: - - run: - command: | - mkdir -p ~/reports - yarn lint --format junit --output-file ~/reports/eslint.xml - when: always - - store_test_results: - path: ~/reports - - store_artifacts: - path: ~/reports - format_check: - description: Run prettier on library - steps: - - run: yarn format:check - -jobs: - lint: - executor: - name: default - steps: - - checkout - - yarn_install - - lint - format_check: - executor: - name: default - steps: - - checkout - - yarn_install - - format_check - -workflows: - build: - jobs: - - cypress/run: - cypress-command: npx cypress run --browser chrome - install-browsers: true - start-command: npm run start:dev - - lint - - format_check diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 000000000..bf74ebfb3 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,30 @@ +name: Run linters and Cypress + +on: + push: + branches-ignore: + - "gh-pages" + pull_request: + branches: + - main + +jobs: + run-linters: + name: Run linters + runs-on: ubuntu-latest + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: 16 + - name: Install Node.js dependencies + run: yarn + - name: Run linters + uses: wearerequired/lint-action@v2 + with: + eslint: true + prettier: true + - name: Cypress run + uses: cypress-io/github-action@v6