11name : Continuous Integration
2- on : [ pull_request]
2+ on : pull_request
33
44permissions :
55 id-token : write
66 contents : read
7+ actions : read
78 checks : write
9+ pull-requests : write
810
911jobs :
1012 build :
1113 name : Build
1214 runs-on : ubuntu-latest
1315 strategy :
1416 matrix :
15- node-version : [18 .x, 20 .x, 22 .x]
17+ node-version : [20 .x, 22 .x, 24 .x]
1618 steps :
1719 - name : Checkout
1820 uses : actions/checkout@v4
1921
20-
2122 - name : Use Node ${{ matrix.node-version }}
2223 uses : actions/setup-node@v4
2324 with :
2425 node-version : ${{ matrix.node-version }}
26+
2527 - name : Install pnpm
2628 uses : pnpm/action-setup@v4
2729 with :
2830 version : 9.15.4
29- - uses : actions/cache@v2
31+
32+ - uses : actions/cache@v4
3033 with :
3134 path : ' **/node_modules'
3235 key : ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
3336
34- - name : PNPM
37+ - name : Install dependencies
3538 run : pnpm install --frozen-lockfile
3639
3740 - name : Build
38- run : pnpm run build
41+ run : pnpm build
3942
4043 lint :
4144 name : Lint
4245 runs-on : ubuntu-latest
4346 steps :
4447 - name : Checkout
4548 uses : actions/checkout@v4
49+
4650 - name : Setup Node
4751 uses : actions/setup-node@v4
4852 with :
4953 node-version : ' 22.x'
54+
5055 - name : Install pnpm
5156 uses : pnpm/action-setup@v4
5257 with :
5358 version : 9.15.4
54-
55- - uses : actions/cache@v2
59+
60+ - uses : actions/cache@v4
5661 with :
5762 path : ' **/node_modules'
5863 key : ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
5964
60- - name : PNPM
65+ - name : Install dependencies
6166 run : pnpm install --frozen-lockfile
6267
6368 - name : Lint
64- run : pnpm run lint
65-
66- - name : Validate Packages
67- run : pnpm manypkg check
69+ run : pnpm lint
6870
6971 test :
70- name : Test
72+ name : Unit Tests
7173 runs-on : ubuntu-latest
7274 strategy :
7375 matrix :
74- project : ['doubles.jest ', 'doubles.sinon ', 'core.unit ', 'doubles.vitest ', 'di.nestjs', 'di.inversify', 'unit ']
76+ project : ['cli ', 'governance ', 'changesets ', 'json-schema-differ ', 'types ']
7577 steps :
7678 - name : Checkout
7779 uses : actions/checkout@v4
@@ -80,47 +82,61 @@ jobs:
8082 uses : actions/setup-node@v4
8183 with :
8284 node-version : ' 22.x'
85+
8386 - name : Install pnpm
8487 uses : pnpm/action-setup@v4
8588 with :
8689 version : 9.15.4
8790
88- - uses : actions/cache@v2
91+ - uses : actions/cache@v4
8992 with :
9093 path : ' **/node_modules'
9194 key : ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
9295
93- - name : PNPM
96+ - name : Install dependencies
9497 run : pnpm install --frozen-lockfile
9598
99+ - name : Build
100+ run : pnpm build
101+
96102 - name : Create Coverage Directory
97103 run : mkdir -p ${{ github.workspace }}/coverage
98104
99105 - name : Test
100- run : pnpm --filter @contractual/${{ matrix.project }} run test
106+ run : pnpm lerna run test --scope @contractual/${{ matrix.project }} --stream
107+ continue-on-error : true
101108 env :
102- JEST_JUNIT_OUTPUT_NAME : ${{ matrix.project }}.xml
103- JEST_JUNIT_OUTPUT_DIR : ${{ github.workspace }}/test-reports
104- JUNIT_OUTPUT_NAME : ${{ matrix.project }}
105- JUNIT_OUTPUT_DIR : ${{ github.workspace }}/test-reports
106109 COVERAGE_DIR : ${{ github.workspace }}/coverage
107110 COVERAGE_FILE : coverage-${{ matrix.project }}.xml
108111
109- - name : Tests Results
110- uses : dorny/test-reporter@v1
111- if : always()
112+ e2e :
113+ name : E2E Tests
114+ runs-on : ubuntu-latest
115+ needs : [build]
116+ steps :
117+ - name : Checkout
118+ uses : actions/checkout@v4
119+
120+ - name : Setup Node
121+ uses : actions/setup-node@v4
112122 with :
113- reporter : ' jest-junit'
114- name : Tests Results (${{ matrix.project }})
115- path : ${{ github.workspace }}/test-reports/${{ matrix.project }}.xml
116- fail-on-error : false
117-
118- # - name: Upload Report to Codecov
119- # uses: codecov/codecov-action@v3
120- # with:
121- # name: codecov-umbrella
122- # flags: ${{ matrix.project }}
123- # token: ${{ secrets.CODECOV_TOKEN }}
124- # fail_ci_if_error: true
125- # files: ${{ github.workspace }}/coverage/coverage-${{ matrix.project }}.xml
126- # verbose: true
123+ node-version : ' 22.x'
124+
125+ - name : Install pnpm
126+ uses : pnpm/action-setup@v4
127+ with :
128+ version : 9.15.4
129+
130+ - uses : actions/cache@v4
131+ with :
132+ path : ' **/node_modules'
133+ key : ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
134+
135+ - name : Install dependencies
136+ run : pnpm install --frozen-lockfile
137+
138+ - name : Build
139+ run : pnpm build
140+
141+ - name : Run E2E Tests
142+ run : pnpm test:e2e
0 commit comments