-
Notifications
You must be signed in to change notification settings - Fork 13
109 lines (92 loc) · 3.03 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
pull_request:
branches:
- master
- master-next
env:
node-version: '18.x'
jobs:
precheck:
name: Check jobs to run
runs-on: ubuntu-22.04
outputs:
affected-typescript-resolver-files: ${{ steps.affected.outputs.typescript-resolver-files }}
affected-typescript-resolver-files-e2e: ${{ steps.affected.outputs.typescript-resolver-files-e2e }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Install deps
run: yarn install --prefer-offline
- name: Check affected projects
id: affected
run: |
echo "::set-output name=typescript-resolver-files::$(./tools/ci/bin/check-affected.sh lib typescript-resolver-files origin/master)"
echo "::set-output name=typescript-resolver-files-e2e::$(./tools/ci/bin/check-affected.sh lib typescript-resolver-files-e2e origin/master)"
typescript-resolver-files:
strategy:
matrix:
os:
- ubuntu-22.04
- windows-latest
node-version: [16.x, 18.x, 20.x]
runs-on: ${{ matrix.os }}
needs: precheck
if: ${{ needs.precheck.outputs.affected-typescript-resolver-files == 'true' }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Install deps
run: yarn install --prefer-offline
- name: Lint
run: yarn nx lint typescript-resolver-files
- name: Test
run: yarn nx test typescript-resolver-files
- name: Build
run: yarn nx build typescript-resolver-files
typescript-resolver-files-e2e:
strategy:
matrix:
os:
- ubuntu-22.04
- windows-latest
node-version: [16.x, 18.x, 20.x]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
needs: precheck
if: ${{ needs.precheck.outputs.affected-typescript-resolver-files == 'true' || needs.precheck.outputs.affected-typescript-resolver-files-e2e == 'true' }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Install deps
run: yarn install --prefer-offline
- name: e2e
run: yarn nx e2e typescript-resolver-files-e2e