diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 2a5f566..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Javascript Node CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-javascript/ for more details -# -version: 2 - -jobs: - build: - docker: - - image: cypress/base:14 - environment: - ## this enables colors in the output - TERM: xterm - - working_directory: ~/repo - - steps: - - checkout - - - run: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash - - run: | - echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV - echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV - - - run: | - nvm install 16 - nvm use 16 - nvm alias default 16 - - - run: npm install -g pnpm - - # Download and cache dependencies - - restore_cache: - keys: - - v11-dependencies-{{ checksum "pnpm-lock.yaml" }} - # fallback to using the latest cache if no exact match is found - - v11-dependencies- - - - run: pnpm install --frozen-lockfile - - - save_cache: - paths: - - node_modules - - packages/docs/node_modules - - packages/test-e2e/node_modules - - packages/test-e2e-composition/node_modules - - packages/test-e2e-composable-vue3/node_modules - - packages/test-ssr/node_modules - - packages/test-ssr-composition/node_modules - - packages/vue-apollo-components/node_modules - - packages/vue-apollo-composable/node_modules - - packages/vue-apollo-option/node_modules - - packages/vue-apollo-ssr/node_modules - - packages/vue-apollo-util/node_modules - - ~/.cache - - ~/.pnpm-store - key: v11-dependencies-{{ checksum "pnpm-lock.yaml" }} - - # run tests! - - run: pnpm run lint - - run: pnpm run build - - run: cd packages/vue-apollo-option && pnpm run test:types - - run: cd packages/vue-apollo-option && pnpm run test:unit - - run: cd packages/vue-apollo-composable && pnpm run test:types - - run: cd packages/test-e2e && pnpm run test:e2e - # - run: cd packages/test-e2e-composition && pnpm run test:e2e - - run: cd packages/test-e2e-composable-vue3 && pnpm run test:e2e - # - run: cd packages/test-ssr && pnpm run test:e2e - # - run: cd packages/test-ssr-composition && pnpm run test:e2e - - - store_artifacts: - path: packages/test-e2e/tests/e2e/videos - - store_artifacts: - path: packages/test-e2e/tests/e2e/screenshots - - store_artifacts: - path: packages/test-e2e-composition/tests/e2e/videos - - store_artifacts: - path: packages/test-e2e-composition/tests/e2e/screenshots - - store_artifacts: - path: packages/test-e2e-composable-vue3/tests/e2e/videos - - store_artifacts: - path: packages/test-e2e-composable-vue3/tests/e2e/screenshots - - store_artifacts: - path: packages/test-ssr/tests/e2e/videos - - store_artifacts: - path: packages/test-ssr/tests/e2e/screenshots - - store_artifacts: - path: packages/test-ssr-composition/tests/e2e/videos - - store_artifacts: - path: packages/test-ssr-composition/tests/e2e/screenshots - - diff --git a/.github/workflows/test-e2e-composable.yml b/.github/workflows/test-e2e-composable.yml new file mode 100644 index 0000000..0620a4a --- /dev/null +++ b/.github/workflows/test-e2e-composable.yml @@ -0,0 +1,71 @@ +name: E2E composable + +on: + push: + branches: + - main + - feat/* + - fix/* + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + runs-on: ubuntu-latest + name: Build and test + + env: + dir: ./packages/test-e2e-composable-vue3 + + steps: + - uses: actions/checkout@v2 + + - name: Install node + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: 8.5.1 + + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + + - name: Cache pnpm modules + uses: actions/cache@v2 + with: + path: | + ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + ~/.cache/Cypress + key: pnpm-v1-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + pnpm-v1-${{ runner.os }}- + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm run build + + - name: E2E tests + run: pnpm run test:e2e + + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: cypress-screenshots + path: ${{env.dir}}/tests/e2e/screenshots + + - uses: actions/upload-artifact@v2 + if: always() + with: + name: cypress-videos + path: ${{env.dir}}/tests/e2e/videos diff --git a/.github/workflows/test-e2e-options.yml b/.github/workflows/test-e2e-options.yml new file mode 100644 index 0000000..865dee4 --- /dev/null +++ b/.github/workflows/test-e2e-options.yml @@ -0,0 +1,71 @@ +name: E2E options/components + +on: + push: + branches: + - main + - feat/* + - fix/* + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + runs-on: ubuntu-latest + name: Build and test + + env: + dir: ./packages/test-e2e + + steps: + - uses: actions/checkout@v2 + + - name: Install node + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: 8.5.1 + + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + + - name: Cache pnpm modules + uses: actions/cache@v2 + with: + path: | + ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + ~/.cache/Cypress + key: pnpm-v1-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + pnpm-v1-${{ runner.os }}- + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm run build + + - name: E2E tests + run: pnpm run test:e2e + + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: cypress-screenshots + path: ${{env.dir}}/tests/e2e/screenshots + + - uses: actions/upload-artifact@v2 + if: always() + with: + name: cypress-videos + path: ${{env.dir}}/tests/e2e/videos diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..20a2566 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,62 @@ +name: Main continuous tests + +on: + push: + branches: + - main + - feat/* + - fix/* + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + runs-on: ubuntu-latest + name: Build and test + + steps: + - uses: actions/checkout@v2 + + - name: Install node + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: 8.5.1 + + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + + - name: Cache pnpm modules + uses: actions/cache@v2 + with: + path: | + ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + ~/.cache/Cypress + key: pnpm-v1-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + pnpm-v1-${{ runner.os }}- + + - name: Install dependencies + run: pnpm install + + - name: Lint + run: pnpm run lint + + - name: Build + run: pnpm run build + + - name: Types + run: pnpm run test:types + + - name: Unit tests + run: pnpm run test:unit diff --git a/package.json b/package.json index 59ac05e..40e879f 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "scripts": { "build": "pnpm run -r --filter \"vue-apollo*\" --filter \"@vue/apollo*\" build", "test": "pnpm run -r test", + "test:unit": "pnpm run -r test:unit", + "test:types": "pnpm run -r test:types", "lint": "eslint . --ext js,vue,ts", "release": "pnpm run build && pnpm run test && sheep release -b v4" },