@@ -6,7 +6,7 @@ name: Tests
6
6
7
7
on :
8
8
pull_request :
9
- branches : [ master, next, dev ]
9
+ branches : [master, next, dev]
10
10
11
11
jobs :
12
12
test-package :
@@ -16,86 +16,84 @@ jobs:
16
16
- macos-latest
17
17
strategy :
18
18
matrix :
19
- node_version : [ '12', '14', '16' ]
19
+ node_version : ['12', '14', '16']
20
20
steps :
21
- - uses : actions/checkout@v2
22
- # Set up Node and Yarn
23
- - uses : actions/setup-node@v2.2.0
24
- with :
25
- # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
26
- node-version : ${{ matrix.node-version }}
27
- # Used to specify a package manager for caching in the default directory. Supported values: npm, yarn
28
- cache : yarn
21
+ - uses : actions/checkout@v2
22
+ # Set up Node and Yarn
23
+ - uses : actions/setup-node@v2.2.0
24
+ with :
25
+ # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
26
+ node-version : ${{ matrix.node-version }}
27
+ # Used to specify a package manager for caching in the default directory. Supported values: npm, yarn
28
+ cache : yarn
29
29
30
- # Caching for Yarn
31
- - id : yarn-cache-dir-path
32
- run : echo "::set-output name=dir::$(yarn cache dir)"
33
- - uses : actions/cache@v2
34
- id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
35
- with :
36
- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
37
- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
38
- restore-keys : |
39
- ${{ runner.os }}-yarn-
30
+ # Caching for Yarn
31
+ - id : yarn-cache-dir-path
32
+ run : echo "::set-output name=dir::$(yarn cache dir)"
33
+ - uses : actions/cache@v2
34
+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
35
+ with :
36
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
37
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
38
+ restore-keys : |
39
+ ${{ runner.os }}-yarn-
40
40
41
- # Install dependencies
42
- - run : yarn workspace use-shopping-cart install --frozen-lockfile
43
- # Run integration and unit tests
44
- - run : yarn workspace use-shopping-cart test
45
- # Run TypeScript type definition tests
46
- - run : yarn workspace use-shopping-cart test:types
41
+ # Install dependencies
42
+ - run : pnpm install --frozen-lockfile
43
+ # Run integration and unit tests
44
+ - run : pnpm --filter use-shopping-cart run test
45
+ # Run TypeScript type definition tests
46
+ - run : pnpm --filter use-shopping-cart run test:types
47
47
48
48
build-package :
49
49
name : Build
50
- runs-on :
51
- ubuntu-latest
50
+ runs-on : ubuntu-latest
52
51
steps :
53
- - uses : actions/checkout@v2
54
- - uses : actions/setup-node@v2
55
- with :
56
- node-version : 16
57
- cache : yarn
52
+ - uses : actions/checkout@v2
53
+ - uses : actions/setup-node@v2
54
+ with :
55
+ node-version : 16
56
+ cache : yarn
57
+
58
+ # Caching for Yarn
59
+ - id : yarn-cache-dir-path
60
+ run : echo "::set-output name=dir::$(yarn cache dir)"
61
+ - uses : actions/cache@v2
62
+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
63
+ with :
64
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
65
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
66
+ restore-keys : |
67
+ ${{ runner.os }}-yarn-
58
68
59
- # Caching for Yarn
60
- - id : yarn-cache-dir-path
61
- run : echo "::set-output name=dir::$(yarn cache dir)"
62
- - uses : actions/cache@v2
63
- id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
64
- with :
65
- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
66
- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
67
- restore-keys : |
68
- ${{ runner.os }}-yarn-
69
+ # Install dependencies
70
+ - run : pnpm install
71
+ # Build package
72
+ - run : pnpm --filter use-shopping-cart run build
69
73
70
- # Install dependencies
71
- - run : yarn workspace use-shopping-cart install --frozen-lockfile
72
- # Build package
73
- - run : yarn workspace use-shopping-cart build
74
-
75
74
lint-package :
76
75
continue-on-error : true
77
76
name : Lint
78
- runs-on :
79
- ubuntu-latest
77
+ runs-on : ubuntu-latest
80
78
steps :
81
- - uses : actions/checkout@v2
82
- - uses : actions/setup-node@v2
83
- with :
84
- node-version : 16
85
- cache : yarn
79
+ - uses : actions/checkout@v2
80
+ - uses : actions/setup-node@v2
81
+ with :
82
+ node-version : 16
83
+ cache : yarn
86
84
87
- # Caching for Yarn
88
- - id : yarn-cache-dir-path
89
- run : echo "::set-output name=dir::$(yarn cache dir)"
90
- - uses : actions/cache@v2
91
- id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
92
- with :
93
- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
94
- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
95
- restore-keys : |
96
- ${{ runner.os }}-yarn-
85
+ # Caching for Yarn
86
+ - id : yarn-cache-dir-path
87
+ run : echo "::set-output name=dir::$(yarn cache dir)"
88
+ - uses : actions/cache@v2
89
+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
90
+ with :
91
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
92
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
93
+ restore-keys : |
94
+ ${{ runner.os }}-yarn-
97
95
98
- # Install dependencies
99
- - run : yarn workspace use-shopping-cart install --frozen-lockfile
100
- # Lint soure code
101
- - run : yarn workspace use-shopping-cart lint
96
+ # Install dependencies
97
+ - run : pnpm install --frozen-lockfile
98
+ # Lint soure code
99
+ - run : pnpm --filter use-shopping-cart run lint
0 commit comments