@@ -26,12 +26,35 @@ jobs:
2626 - name : Lint
2727 run : npm run lint
2828
29+ build :
30+ runs-on : ubuntu-latest
31+ steps :
32+ - uses : actions/checkout@v6
33+ - uses : actions/setup-node@v6
34+ with :
35+ node-version : lts/*
36+
37+ - name : Install Packages
38+ run : npm install
39+
40+ - name : Build
41+ run : npm run build
42+
43+ - name : Cache dist
44+ uses : actions/upload-artifact@v6
45+ with :
46+ retention-days : 3
47+ name : dist
48+ path : dist
49+
2950 test :
3051 name : Test
3152 strategy :
3253 matrix :
3354 node : [18, 20, 21, 'lts/*']
3455 runs-on : ubuntu-latest
56+ needs :
57+ - build
3558 steps :
3659 - name : Checkout
3760 uses : actions/checkout@v5
@@ -41,12 +64,18 @@ jobs:
4164 node-version : ${{ matrix.node }}
4265 - name : Install Packages
4366 run : npm install
67+ - name : Restore dist cache
68+ uses : actions/download-artifact@v7
69+ with :
70+ name : dist
4471 - name : Test
4572 run : npm test
4673
4774 test-with-eslint-v8 :
4875 name : Test with ESLint v8
4976 runs-on : ubuntu-latest
77+ needs :
78+ - build
5079 steps :
5180 - name : Checkout
5281 uses : actions/checkout@v5
@@ -58,12 +87,18 @@ jobs:
5887 run : npm install
5988 - name : Install ESLint v8
6089 run : npm install --save-dev eslint@8 --force
90+ - name : Restore dist cache
91+ uses : actions/download-artifact@v7
92+ with :
93+ name : dist
6194 - name : Test
6295 run : npm test
6396
6497 test-without-eslint-stylistic :
6598 name : Test without ESLint Stylistic
6699 runs-on : ubuntu-latest
100+ needs :
101+ - build
67102 steps :
68103 - name : Checkout
69104 uses : actions/checkout@v5
@@ -73,6 +108,10 @@ jobs:
73108 run : npm install
74109 - name : Uninstall @stylistic/eslint-plugin
75110 run : npm uninstall @stylistic/eslint-plugin
111+ - name : Restore dist cache
112+ uses : actions/download-artifact@v7
113+ with :
114+ name : dist
76115 - name : Test
77116 run : npm test
78117
82121 matrix :
83122 stylistic : [2, 3, 4]
84123 runs-on : ubuntu-latest
124+ needs :
125+ - build
85126 steps :
86127 - name : Checkout
87128 uses : actions/checkout@v5
@@ -91,12 +132,18 @@ jobs:
91132 run : npm install
92133 - name : Install @stylistic/eslint-plugin v${{ matrix.stylistic }}
93134 run : npm install -D @stylistic/eslint-plugin@${{ matrix.stylistic }} --force
135+ - name : Restore dist cache
136+ uses : actions/download-artifact@v7
137+ with :
138+ name : dist
94139 - name : Test
95140 run : npm test
96141
97142 test-with-typescript-eslint-v7 :
98143 name : Test with typescript-eslint v7
99144 runs-on : ubuntu-latest
145+ needs :
146+ - build
100147 steps :
101148 - name : Checkout
102149 uses : actions/checkout@v5
@@ -106,5 +153,9 @@ jobs:
106153 run : npm install
107154 - name : Install @typescript-eslint/parser v7
108155 run : npm install -D @typescript-eslint/parser@7 --force
156+ - name : Restore dist cache
157+ uses : actions/download-artifact@v7
158+ with :
159+ name : dist
109160 - name : Test
110161 run : npm test
0 commit comments