ci: switch to github actions

This commit is contained in:
Guillaume Chau
2023-05-16 10:38:08 +02:00
parent 81ea32c248
commit 25c31d22c3
5 changed files with 206 additions and 92 deletions
-92
View File
@@ -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
+71
View File
@@ -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
+71
View File
@@ -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
+62
View File
@@ -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
+2
View File
@@ -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"
},