Skip to content

Commit 74df25f

Browse files
committed
chore: ci
1 parent 876c82d commit 74df25f

File tree

3 files changed

+76
-3
lines changed

3 files changed

+76
-3
lines changed

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ master ]
10+
pull_request:
11+
branches: [ master ]
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
build:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
- uses: actions/checkout@v2
24+
25+
- name: Get yarn cache directory path
26+
id: yarn-cache-dir-path
27+
run: echo "::set-output name=dir::$(yarn cache dir)"
28+
29+
- name: Yarn cache
30+
uses: actions/cache@v1
31+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
32+
with:
33+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
34+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-yarn-
37+
38+
- name: Dependencies cache
39+
uses: actions/cache@v2
40+
with:
41+
path: |
42+
node_modules
43+
**/node_modules
44+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
45+
46+
- name: Cypress cache
47+
uses: actions/cache@v1
48+
with:
49+
path: /home/runner/.cache/Cypress
50+
key: ${{ runner.os }}-Cypress-v1
51+
52+
- name: Install
53+
run: yarn --frozen-lockfile
54+
55+
# Runs a single command using the runners shell
56+
- name: Lint
57+
run: |
58+
yarn run lint
59+
60+
- name: Build package
61+
run: |
62+
yarn run build
63+
64+
# Runs a set of commands using the runners shell
65+
- name: E2E tests
66+
run: |
67+
yarn run test:e2e
68+
69+
- uses: actions/upload-artifact@v1
70+
with:
71+
name: Cypress Videos
72+
path: cypress/videos

cypress/plugins/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
* @type {Cypress.PluginConfig}
1717
*/
1818
module.exports = (on, config) => {
19-
// `on` is used to hook into various events Cypress emits
20-
// `config` is the resolved Cypress config
19+
// `on` is used to hook into various events Cypress emits
20+
// `config` is the resolved Cypress config
2121
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"build:browser": "rollup --config build/rollup.config.browser.js",
2222
"build:es": "rollup --config build/rollup.config.es.js",
2323
"build:umd": "rollup --config build/rollup.config.umd.js",
24-
"prepublishOnly": "npm run build && npm run test",
24+
"prepublishOnly": "npm run build && npm run lint && npm run test",
25+
"lint": "eslint . --ext js",
2526
"serve": "serve -p 8080",
2627
"test": "start-server-and-test serve 8080 test:e2e",
2728
"test:e2e:open": "cypress open",

0 commit comments

Comments
 (0)