From 1aaffdace141b6a9937a1aebd54d1b29594d4ca3 Mon Sep 17 00:00:00 2001 From: Zac Boyd Date: Mon, 12 Aug 2024 13:44:43 +0930 Subject: [PATCH 1/3] remove .circleci directory and config --- .circleci/config.yml | 172 ------------------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 3a0d04b74..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,172 +0,0 @@ -version: 2.1 - -executors: - node14: - docker: - - image: cimg/node:14.17 - resource_class: medium - working_directory: ~/repo - - node16: - docker: - - image: cimg/node:16.20.1 - resource_class: medium - working_directory: ~/repo - - node18: - docker: - - image: cimg/node:18.18.1 - resource_class: medium - working_directory: ~/repo - - node20: - docker: - - image: cimg/node:20.4.0 - resource_class: medium - working_directory: ~/repo - -commands: - prepare-repository: - description: Convenience command to checkout the repository and install dependencies - steps: - - checkout - - restore_cache: - keys: - - v3-dependencies-{{ checksum "yarn.lock" }} - - v3-dependencies - - run: - name: Install main dependencies - command: yarn install --frozen-lockfile - - save_cache: - paths: - - node_modules - key: v3-dependencies-{{ checksum "yarn.lock" }} - - restore_cache: - keys: - - v3-docs-dependencies-{{ checksum "docs/yarn.lock" }} - - v3-docs-dependencies - - run: - name: Install docs dependencies - command: yarn install --frozen-lockfile - working_directory: docs/ - - save_cache: - paths: - - docs/node_modules - key: v3-docs-dependencies-{{ checksum "docs/yarn.lock" }} - - build-and-test: - description: Run the unit tests - parameters: - node_version: - type: integer - description: Which integer major version of Node this invocation is using. - steps: - - prepare-repository - - run: - name: Compile the repository on this version of Node. - command: yarn build - - run: - name: Run the tests on this version of Node. - environment: - JEST_JUNIT_OUTPUT_DIR: ./test-reports/jest - JEST_JUNIT_OUTPUT_NAME: results.xml - JEST_JUNIT_CLASSNAME: "{filepath}" - command: | - set -uex - TESTFILES=$(circleci tests glob lib/**/*.spec.ts | circleci tests split --split-by=timings) - yarn ci:test $TESTFILES - - store_test_results: - path: ./test-reports - - run: - name: Build the documentation. - command: | - set -uex - if [ << parameters.node_version >> -gt 16 ]; then - # Without this, we get `Error: error:0308010C:digital envelope routines::unsupported` on Node >= 17. - export NODE_OPTIONS="--openssl-legacy-provider" - fi - yarn build-docs - -jobs: - test-node14: - executor: node14 - parallelism: 4 - steps: - - build-and-test: - node_version: 14 - - test-node16: - executor: node16 - parallelism: 4 - steps: - - build-and-test: - node_version: 16 - - test-node18: - executor: node18 - parallelism: 4 - steps: - - build-and-test: - node_version: 18 - - test-node20: - executor: node20 - parallelism: 4 - steps: - - build-and-test: - node_version: 20 - - lint-check: - executor: node14 - steps: - - prepare-repository - - run: - name: Run lint checker - command: yarn lint:check - - publish: - executor: node14 - steps: - - prepare-repository - - run: - name: Authenticate with NPM registry - command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc - - deploy: - name: Publish - command: npm publish --access=public - -workflows: - build-and-test: - jobs: - - test-node14: - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ - - test-node16: - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ - - test-node18: - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ - - test-node20: - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ - - lint-check: - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ - - publish: - requires: - - test-node14 - - test-node16 - - test-node18 - - test-node20 - - lint-check - filters: - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ - branches: - ignore: /.*/ From faddc77e94ec32df19845f0580bf8e5d47f8b652 Mon Sep 17 00:00:00 2001 From: Zac Boyd Date: Tue, 13 Aug 2024 13:45:06 +0930 Subject: [PATCH 2/3] move test-summary into seperate step to consolidate results --- .github/workflows/build-and-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2be382793..202114d09 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -52,6 +52,9 @@ jobs: name: test-results-node-${{ matrix.node-version }}-${{ matrix.shard }} path: ./test-reports + test-summary: + runs-on: runs-on,runner=4cpu-linux-x64 + steps: - name: Test summary uses: test-summary/action@v2 with: From 164a12e8f83173f89708295cb3df937e2bc85433 Mon Sep 17 00:00:00 2001 From: Zac Boyd Date: Tue, 13 Aug 2024 15:24:37 +0930 Subject: [PATCH 3/3] add conditional to the test summary step to stop it running early --- .github/workflows/build-and-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 202114d09..8b6b51070 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -52,8 +52,9 @@ jobs: name: test-results-node-${{ matrix.node-version }}-${{ matrix.shard }} path: ./test-reports - test-summary: + test-summary-publish: runs-on: runs-on,runner=4cpu-linux-x64 + needs: [test] steps: - name: Test summary uses: test-summary/action@v2