From 9ee47eb7fde150f81171150ce7048b3702f45375 Mon Sep 17 00:00:00 2001 From: Filipp Riabchun Date: Sun, 24 Nov 2019 16:50:53 +0100 Subject: [PATCH] Add CI job --- .github/workflows/tests-puppeteer.yml | 32 ++++++++++++++++++++++++ examples/official-storybook/package.json | 4 +-- lib/api/src/version.ts | 2 +- scripts/test.js | 8 +++--- 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/tests-puppeteer.yml diff --git a/.github/workflows/tests-puppeteer.yml b/.github/workflows/tests-puppeteer.yml new file mode 100644 index 000000000000..e7590c6e644d --- /dev/null +++ b/.github/workflows/tests-puppeteer.yml @@ -0,0 +1,32 @@ +name: Puppeteer & A11y tests + +on: [push] + +jobs: + build: + + name: Puppeteer & A11y tests + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v1 + with: + node-version: '10.x' + - uses: actions/checkout@v1 + - name: Cache node modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-build-${{ env.cache-name }}- + ${{ runner.OS }}-build- + ${{ runner.OS }}- + - name: install, bootstrap + run: | + yarn bootstrap --core + - name: build storybook + run: | + yarn --cwd examples/official-storybook build-storybook + - name: test + run: | + yarn test --puppeteer diff --git a/examples/official-storybook/package.json b/examples/official-storybook/package.json index 069968b39281..628e6255c078 100644 --- a/examples/official-storybook/package.json +++ b/examples/official-storybook/package.json @@ -54,6 +54,7 @@ "lodash": "^4.17.15", "paths.macro": "^2.0.2", "prop-types": "^15.7.2", + "puppeteer": "^2.0.0", "react": "^16.8.3", "react-dom": "^16.8.3", "storybook-chromatic": "^3.0.0", @@ -61,8 +62,5 @@ "ts-loader": "^6.0.0", "uuid": "^3.3.2", "webpack": "^4.33.0" - }, - "optionalDependencies": { - "puppeteer": "^2.0.0" } } diff --git a/lib/api/src/version.ts b/lib/api/src/version.ts index 7ea61ab7e509..da0b027db8cc 100644 --- a/lib/api/src/version.ts +++ b/lib/api/src/version.ts @@ -1 +1 @@ -export const version = '5.3.0-beta.5'; +export const version = '5.3.0-beta.6'; diff --git a/scripts/test.js b/scripts/test.js index 60f58c62c232..dc936233bfa9 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -50,11 +50,11 @@ const tasks = { projectLocation: '', isJest: true, }), - image: createProject({ - name: `Image snapshots for Official storybook ${chalk.gray('(image)')}`, + puppeteer: createProject({ + name: `Puppeteer and A11y tests for Official storybook ${chalk.gray('(puppeteer)')}`, defaultValue: false, - option: '--image', - projectLocation: path.join(__dirname, '..', 'examples/official-storybook/image-snapshots'), + option: '--puppeteer', + projectLocation: path.join(__dirname, '..', 'examples/official-storybook/storyshots-puppeteer'), isJest: true, }), cli: createProject({