From 7b6e987ce7c6701505fbd1721921c6f309f8d362 Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> Date: Sat, 25 Jul 2020 14:16:23 +0530 Subject: [PATCH] feat: use GitHub actions instead of CircleCI (#2417) --- .circleci/config.yml | 123 -------------------------- .github/workflows/pull-request-ci.yml | 42 +++++++++ 2 files changed, 42 insertions(+), 123 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/pull-request-ci.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] } diff --git a/.github/workflows/pull-request-ci.yml b/.github/workflows/pull-request-ci.yml new file mode 100644 index 0000000000..77633b3135 --- /dev/null +++ b/.github/workflows/pull-request-ci.yml @@ -0,0 +1,42 @@ +name: Pull request workflow + +on: + pull_request: + +jobs: + 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 + with: + 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 dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn + + - name: Run tsc + run: yarn tsc + + - name: Run unit tests + run: yarn test + + - name: Check linter + run: yarn lint + + - name: Check markdown linter + run: yarn workspace docs lint-md + + - name: Build vuepress + run: yarn build \ No newline at end of file