From 5662b455be7fed2e32815c50710e4b2f4a3bd54d Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni Date: Mon, 1 Jun 2020 11:25:10 +0530 Subject: [PATCH 1/5] refactor(ci): remove circle ci conf --- .circleci/config.yml | 123 ------------------------------------------- 1 file changed, 123 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b5f2e8d99e..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,123 +0,0 @@ -# Javascript Node CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-javascript/ for more details -# -version: 2.1 - -defaults: &defaults - working_directory: ~/project - docker: - - image: circleci/node:latest - -jobs: - - #------------------------------------------------------------ - # 1. Install dependencies - #------------------------------------------------------------ - - install-dependencies: - <<: *defaults - steps: - - checkout - - - restore_cache: - keys: - - v1-deps-{{ checksum "yarn.lock" }} - - v1-deps - - - run: - name: 'Install dependencies' - command: yarn --frozen-lockfile --non-interactive - - - save_cache: - key: v1-deps-{{ checksum "yarn.lock" }} - paths: - - ~/.cache/yarn - - - persist_to_workspace: - root: ~/project - paths: - - node_modules - - packages/*/node_modules - - packages/@vuepress/*/node_modules - - #------------------------------------------------------------ - # 2. Run parallel jobs: - # => tsc - # => tests - # => linter - # => docs linter - #------------------------------------------------------------ - - run-tsc: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: 'Run tsc' - command: yarn tsc - - persist_to_workspace: - root: ~/project - paths: - - packages/@vuepress/shared-utils/lib - - run-tests: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: 'Run tests' - command: yarn test - - run-linter-check: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: 'Run linter' - command: yarn lint - - run-docs-linter-check: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: 'Run md linter' - command: yarn workspace docs lint-md - - #------------------------------------------------------------ - # 3. Build VuePress - #------------------------------------------------------------ - - build: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: 'Run tests' - command: yarn build - -#------------------------------------------------------------ -# Workflows -#------------------------------------------------------------ - -workflows: - version: 2 - build: - jobs: - - install-dependencies - - run-linter-check: { requires: [install-dependencies] } - - run-docs-linter-check: { requires: [install-dependencies] } - - run-tsc: { requires: [install-dependencies] } - - run-tests: { requires: [run-tsc] } - - build: { requires: [run-tests, run-linter-check, run-docs-linter-check] } From 94c353d8570a2eb7ad3f5532b5a7f2f5abf69494 Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni Date: Mon, 1 Jun 2020 11:25:25 +0530 Subject: [PATCH 2/5] feat: add github actions --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..ab474116cf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: ci + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + ci: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node: [12, 14] + + steps: + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: checkout + uses: actions/checkout@master + + - name: cache node_modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} + + - name: install deps + run: yarn --check-files --frozen-lockfile --non-interactive + + - name: tsc + run: yarn tsc + + - name: test + run: yarn test + + - name: lint + run: yarn lint + + - name: md + run: yarn workspace docs lint-md + + - name: build + run: yarn build From 2aed3a0899c9ac856a0cfbe36736ed3f87aac7b2 Mon Sep 17 00:00:00 2001 From: Franck Date: Sat, 25 Jul 2020 10:30:28 +0200 Subject: [PATCH 3/5] fix: improve ci deps cache management --- .github/workflows/ci.yml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab474116cf..3e7a12d366 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,37 +1,32 @@ -name: ci +name: Pull request workflow on: - push: - branches: - - master pull_request: - branches: - - master jobs: ci: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest] - node: [12, 14] + runs-on: ubuntu-latest steps: + - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node }} + node-version: '12' - - name: checkout - uses: actions/checkout@master + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" - - name: cache node_modules - uses: actions/cache@v1 + - uses: actions/cache@v1 with: - path: node_modules - key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node-modules- + ${{ runner.os }}- - name: install deps + if: steps.yarn-cache.outputs.cache-hit != 'true' run: yarn --check-files --frozen-lockfile --non-interactive - name: tsc From a35c43c3d5bb5c974e9b1a2ca0b16f22bb2ae6f5 Mon Sep 17 00:00:00 2001 From: Franck Date: Sat, 25 Jul 2020 10:37:51 +0200 Subject: [PATCH 4/5] feat: rename ci file --- .github/workflows/{ci.yml => pull-request-ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci.yml => pull-request-ci.yml} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/pull-request-ci.yml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/pull-request-ci.yml From b96aef67e0c5212af3d5dca929b35f4d016b9756 Mon Sep 17 00:00:00 2001 From: Franck Date: Sat, 25 Jul 2020 10:41:33 +0200 Subject: [PATCH 5/5] fix: ci file format --- .github/workflows/pull-request-ci.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pull-request-ci.yml b/.github/workflows/pull-request-ci.yml index 3e7a12d366..77633b3135 100644 --- a/.github/workflows/pull-request-ci.yml +++ b/.github/workflows/pull-request-ci.yml @@ -4,20 +4,17 @@ on: pull_request: jobs: - ci: + pr: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: '12' - - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v1 + - uses: actions/cache@v1 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} @@ -25,21 +22,21 @@ jobs: ${{ runner.os }}-node-modules- ${{ runner.os }}- - - name: install deps + - name: Install dependencies if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn --check-files --frozen-lockfile --non-interactive + run: yarn - - name: tsc + - name: Run tsc run: yarn tsc - - name: test + - name: Run unit tests run: yarn test - - name: lint + - name: Check linter run: yarn lint - - name: md + - name: Check markdown linter run: yarn workspace docs lint-md - - name: build - run: yarn build + - name: Build vuepress + run: yarn build \ No newline at end of file