@comicrelief/component-library 5.7.0 → 5.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/main.yml +131 -0
- package/.github/workflows/pr-checks.yml +17 -0
- package/README.md +6 -6
- package/package.json +1 -1
- package/.circleci/config.yml +0 -54
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
name: Main
|
|
2
|
+
|
|
3
|
+
on: [push]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
lint:
|
|
7
|
+
name: Lint
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- name: Checkout
|
|
11
|
+
uses: actions/checkout@v3
|
|
12
|
+
|
|
13
|
+
- name: Set up Node
|
|
14
|
+
uses: actions/setup-node@v3
|
|
15
|
+
with:
|
|
16
|
+
node-version: 14
|
|
17
|
+
|
|
18
|
+
- name: Restore packages cache
|
|
19
|
+
uses: actions/cache@v3
|
|
20
|
+
with:
|
|
21
|
+
path: '**/node_modules'
|
|
22
|
+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: yarn install --frozen-lockfile --ignore-scripts
|
|
26
|
+
|
|
27
|
+
- name: Run ESLint
|
|
28
|
+
run: yarn lint
|
|
29
|
+
|
|
30
|
+
unit-test:
|
|
31
|
+
name: Unit test
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout
|
|
35
|
+
uses: actions/checkout@v3
|
|
36
|
+
|
|
37
|
+
- name: Set up Node
|
|
38
|
+
uses: actions/setup-node@v3
|
|
39
|
+
with:
|
|
40
|
+
node-version: 14
|
|
41
|
+
|
|
42
|
+
- name: Restore packages cache
|
|
43
|
+
uses: actions/cache@v3
|
|
44
|
+
with:
|
|
45
|
+
path: '**/node_modules'
|
|
46
|
+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
47
|
+
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
run: yarn install --frozen-lockfile --ignore-scripts
|
|
50
|
+
|
|
51
|
+
- name: Build
|
|
52
|
+
run: yarn build
|
|
53
|
+
|
|
54
|
+
- name: Run unit tests
|
|
55
|
+
run: yarn test --maxWorkers=2
|
|
56
|
+
env:
|
|
57
|
+
NODE_OPTIONS: --max_old_space_size=4096
|
|
58
|
+
|
|
59
|
+
cypress:
|
|
60
|
+
name: Cypress test
|
|
61
|
+
needs:
|
|
62
|
+
- lint
|
|
63
|
+
- unit-test
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- name: Checkout
|
|
67
|
+
uses: actions/checkout@v3
|
|
68
|
+
|
|
69
|
+
- name: Set up Node
|
|
70
|
+
uses: actions/setup-node@v3
|
|
71
|
+
with:
|
|
72
|
+
node-version: 14
|
|
73
|
+
|
|
74
|
+
# see https://github.com/marketplace/actions/cypress-io
|
|
75
|
+
- name: Run Cypress tests
|
|
76
|
+
uses: cypress-io/github-action@v2
|
|
77
|
+
with:
|
|
78
|
+
start: yarn styleguide
|
|
79
|
+
command: yarn cy:run
|
|
80
|
+
wait-on: http://localhost:6060
|
|
81
|
+
env:
|
|
82
|
+
NODE_OPTIONS: --max_old_space_size=4096
|
|
83
|
+
|
|
84
|
+
# NOTE: screenshots will be generated only if the tests failed
|
|
85
|
+
# thus we store screenshots only on failures
|
|
86
|
+
- name: Upload screenshots
|
|
87
|
+
uses: actions/upload-artifact@v3
|
|
88
|
+
if: failure()
|
|
89
|
+
with:
|
|
90
|
+
name: cypress-screenshots
|
|
91
|
+
path: cypress/screenshots
|
|
92
|
+
|
|
93
|
+
# Test run video was always captured, so this action uses "always()" condition
|
|
94
|
+
- name: Upload videos
|
|
95
|
+
uses: actions/upload-artifact@v3
|
|
96
|
+
if: always()
|
|
97
|
+
with:
|
|
98
|
+
name: cypress-videos
|
|
99
|
+
path: cypress/videos
|
|
100
|
+
|
|
101
|
+
publish:
|
|
102
|
+
name: Publish package to npm
|
|
103
|
+
if: github.ref == 'refs/heads/master'
|
|
104
|
+
needs: cypress
|
|
105
|
+
runs-on: ubuntu-latest
|
|
106
|
+
steps:
|
|
107
|
+
- name: Checkout
|
|
108
|
+
uses: actions/checkout@v3
|
|
109
|
+
|
|
110
|
+
- name: Set up Node
|
|
111
|
+
uses: actions/setup-node@v3
|
|
112
|
+
with:
|
|
113
|
+
node-version: 14
|
|
114
|
+
|
|
115
|
+
- name: Restore packages cache
|
|
116
|
+
uses: actions/cache@v3
|
|
117
|
+
with:
|
|
118
|
+
path: '**/node_modules'
|
|
119
|
+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
120
|
+
|
|
121
|
+
- name: Install dependencies
|
|
122
|
+
run: yarn install --frozen-lockfile --ignore-scripts
|
|
123
|
+
|
|
124
|
+
- name: Build
|
|
125
|
+
run: yarn build
|
|
126
|
+
|
|
127
|
+
- name: Release
|
|
128
|
+
run: yarn semantic-release
|
|
129
|
+
env:
|
|
130
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
131
|
+
NPM_TOKEN: ${{ secrets.NPM_PUBLISHING_TOKEN }}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: PR
|
|
2
|
+
|
|
3
|
+
on: [pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
# https://github.com/amannn/action-semantic-pull-request#example-config
|
|
7
|
+
check-semantic-pr:
|
|
8
|
+
name: Semantic pull request
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
# Please look up the latest version from
|
|
12
|
+
# https://github.com/amannn/action-semantic-pull-request/releases
|
|
13
|
+
- uses: amannn/action-semantic-pull-request@v4.4.0
|
|
14
|
+
env:
|
|
15
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
16
|
+
with:
|
|
17
|
+
validateSingleCommit: true
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Comic Relief React Component Library
|
|
2
2
|
--------------
|
|
3
3
|
|
|
4
|
-
[](https://github.com/comicrelief/component-library/actions)
|
|
5
5
|
[](https://github.com/semantic-release/semantic-release)
|
|
6
6
|
|
|
7
7
|
React components to be shared across Comic Relief applications
|
|
@@ -27,24 +27,24 @@ import { HeroBanner } from '@comic-relief/component-library';
|
|
|
27
27
|
|
|
28
28
|
### Develop
|
|
29
29
|
|
|
30
|
-
To install CR-CL locally run
|
|
30
|
+
To install CR-CL locally, run:
|
|
31
31
|
|
|
32
32
|
```
|
|
33
33
|
$ yarn install
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
To start
|
|
36
|
+
To start the dev build and server:
|
|
37
37
|
```
|
|
38
38
|
$ yarn styleguide
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
To test
|
|
41
|
+
To test:
|
|
42
42
|
```
|
|
43
43
|
$ yarn test
|
|
44
44
|
```
|
|
45
|
-
_Test will run through all
|
|
45
|
+
_Test will run through all Jest tests and watch for any changes on snapshots._
|
|
46
46
|
|
|
47
|
-
To update snapshots
|
|
47
|
+
To update snapshots with desired changes brought in through your work:
|
|
48
48
|
```
|
|
49
49
|
$ yarn test -u
|
|
50
50
|
```
|
package/package.json
CHANGED
package/.circleci/config.yml
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Javascript Node CircleCI 2.0 configuration file
|
|
2
|
-
#
|
|
3
|
-
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
|
|
4
|
-
#
|
|
5
|
-
version: 2
|
|
6
|
-
jobs:
|
|
7
|
-
build:
|
|
8
|
-
docker:
|
|
9
|
-
|
|
10
|
-
# See https://github.com/cypress-io/cypress-docker-images
|
|
11
|
-
- image: cypress/browsers:node14.16.0-chrome89-ff77
|
|
12
|
-
environment:
|
|
13
|
-
TERM: xterm
|
|
14
|
-
NODE_OPTIONS: --max_old_space_size=4096
|
|
15
|
-
|
|
16
|
-
working_directory: ~/repo
|
|
17
|
-
|
|
18
|
-
steps:
|
|
19
|
-
- checkout
|
|
20
|
-
|
|
21
|
-
# Download and cache dependencies
|
|
22
|
-
- restore_cache:
|
|
23
|
-
key: dependency-cache-{{ checksum "yarn.lock" }}
|
|
24
|
-
|
|
25
|
-
- run: yarn install
|
|
26
|
-
|
|
27
|
-
- save_cache:
|
|
28
|
-
key: dependency-cache-{{ checksum "yarn.lock" }}
|
|
29
|
-
paths:
|
|
30
|
-
- node_modules
|
|
31
|
-
- /root/.cache/Cypress
|
|
32
|
-
|
|
33
|
-
# run tests!
|
|
34
|
-
- run:
|
|
35
|
-
name: Test Code Style
|
|
36
|
-
command: yarn lint
|
|
37
|
-
|
|
38
|
-
- run:
|
|
39
|
-
name: Run unit tests
|
|
40
|
-
command: yarn test --maxWorkers=2
|
|
41
|
-
|
|
42
|
-
- run:
|
|
43
|
-
name: Release to npm
|
|
44
|
-
command: yarn semantic-release
|
|
45
|
-
|
|
46
|
-
- run:
|
|
47
|
-
name: Run feature tests
|
|
48
|
-
command: yarn feature-test
|
|
49
|
-
|
|
50
|
-
- store_artifacts:
|
|
51
|
-
path: cypress/videos
|
|
52
|
-
|
|
53
|
-
- store_artifacts:
|
|
54
|
-
path: cypress/screenshots
|