66 pull_request :
77
88jobs :
9- build-lint-test :
10- name : Build, Lint, and Test
11- runs-on : ubuntu-20.04
9+ prepare :
10+ name : Prepare
11+ runs-on : ubuntu-latest
12+ outputs :
13+ YARN_CACHE_DIR : ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }}
14+ YARN_VERSION : ${{ steps.yarn-version.outputs.YARN_VERSION }}
1215 strategy :
1316 matrix :
14- node-version : [14.x, 16.x, 18.x]
17+ node-version : [14.x, 16.x, 18.x, 19.x ]
1518 steps :
1619 - uses : actions/checkout@v3
1720 - name : Use Node.js ${{ matrix.node-version }}
@@ -24,39 +27,123 @@ jobs:
2427 - name : Get Yarn version
2528 run : echo "YARN_VERSION=$(yarn --version)" >> "$GITHUB_OUTPUT"
2629 id : yarn-version
27- - name : Cache yarn dependencies
30+ - name : Cache Yarn dependencies
2831 uses : actions/cache@v3
2932 with :
3033 path : ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }}
31- key : yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}
34+ key : yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
35+ - name : Install Yarn dependencies
36+ run : yarn --immutable
37+ build :
38+ name : Build
39+ runs-on : ubuntu-latest
40+ needs :
41+ - prepare
42+ strategy :
43+ matrix :
44+ node-version : [14.x, 16.x, 18.x, 19.x]
45+ steps :
46+ - uses : actions/checkout@v3
47+ - name : Use Node.js ${{ matrix.node-version }}
48+ uses : actions/setup-node@v3
49+ with :
50+ node-version : ${{ matrix.node-version }}
51+ - name : Restore Yarn dependencies
52+ uses : actions/cache@v3
53+ with :
54+ path : ${{ needs.prepare.outputs.YARN_CACHE_DIR }}
55+ key : yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
3256 - run : yarn --immutable
3357 - run : yarn build
34- - run : yarn lint
35- - run : yarn test
36- validate-changelog :
37- name : Validate changelog
38- runs-on : ubuntu-20.04
58+ - name : Require clean working directory
59+ shell : bash
60+ run : |
61+ if ! git diff --exit-code; then
62+ echo "Working tree dirty at end of job"
63+ exit 1
64+ fi
65+ lint :
66+ name : Lint
67+ runs-on : ubuntu-latest
68+ needs :
69+ - prepare
70+ strategy :
71+ matrix :
72+ node-version : [14.x, 16.x, 18.x, 19.x]
3973 steps :
4074 - uses : actions/checkout@v3
41- - name : Get Node.js version
42- id : nvm
43- run : echo "NODE_VERSION=$(cat .nvmrc)" >> "$GITHUB_OUTPUT"
44- - uses : actions/setup-node@v3
75+ - name : Use Node.js ${{ matrix.node-version }}
76+ uses : actions/setup-node@v3
4577 with :
46- node-version : ${{ steps.nvm.outputs.NODE_VERSION }}
78+ node-version : ${{ matrix.node-version }}
79+ - name : Restore Yarn dependencies
80+ uses : actions/cache@v3
81+ with :
82+ path : ${{ needs.prepare.outputs.YARN_CACHE_DIR }}
83+ key : yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
4784 - run : yarn --immutable
85+ - run : yarn lint
4886 - run : yarn build
4987 - name : Validate RC changelog
5088 if : ${{ startsWith(github.head_ref, 'release/') }}
51- run : yarn changelog validate --rc
89+ run : yarn auto- changelog validate --rc
5290 - name : Validate changelog
5391 if : ${{ !startsWith(github.head_ref, 'release/') }}
54- run : yarn changelog validate
92+ run : yarn auto-changelog validate
93+ - name : Require clean working directory
94+ shell : bash
95+ run : |
96+ if ! git diff --exit-code; then
97+ echo "Working tree dirty at end of job"
98+ exit 1
99+ fi
100+ test :
101+ name : Test
102+ runs-on : ubuntu-latest
103+ needs :
104+ - prepare
105+ strategy :
106+ matrix :
107+ node-version : [14.x, 16.x, 18.x, 19.x]
108+ steps :
109+ - uses : actions/checkout@v3
110+ - name : Use Node.js ${{ matrix.node-version }}
111+ uses : actions/setup-node@v3
112+ with :
113+ node-version : ${{ matrix.node-version }}
114+ - name : Restore Yarn dependencies
115+ uses : actions/cache@v3
116+ with :
117+ path : ${{ needs.prepare.outputs.YARN_CACHE_DIR }}
118+ key : yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
119+ - run : yarn --immutable
120+ - run : yarn test
121+ - name : Require clean working directory
122+ shell : bash
123+ run : |
124+ if ! git diff --exit-code; then
125+ echo "Working tree dirty at end of job"
126+ exit 1
127+ fi
128+ check-workflows :
129+ name : Check workflows
130+ runs-on : ubuntu-latest
131+ steps :
132+ - uses : actions/checkout@v3
133+ - name : Download actionlint
134+ id : download-actionlint
135+ run : bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/d5f726fb9c9aaff30c8c3787a9b9640f7612838a/scripts/download-actionlint.bash) 1.6.21
136+ shell : bash
137+ - name : Check workflow files
138+ run : ${{ steps.download-actionlint.outputs.executable }} -color
139+ shell : bash
55140 all-jobs-pass :
56141 name : All jobs pass
57- runs-on : ubuntu-20.04
142+ runs-on : ubuntu-latest
58143 needs :
59- - build-lint-test
60- - validate-changelog
144+ - build
145+ - lint
146+ - test
147+ - check-workflows
61148 steps :
62149 - run : echo "Great success!"
0 commit comments