-
Notifications
You must be signed in to change notification settings - Fork 214
130 lines (103 loc) · 4.04 KB
/
ci_checks.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI Checks
on:
push:
branches:
- master
pull_request:
env:
NODE_VERSION: 20
JAVA_VERSION: 21
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_READ_WRITE_TOKEN }}
jobs:
main-linux:
name: Main Linux
runs-on: ubuntu-latest
env:
NX_CI_EXECUTION_ENV: 'linux'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'master'
- run: git branch --track master origin/master
if: ${{ github.event_name == 'pull_request' }}
- name: Ensure Nx Cloud Agents are configured correctly
run: yarn dlx nx-cloud validate --workflow-file=./.nx/workflows/agents.yaml
- name: Start the Nx Cloud CI Run
run: |
yarn dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --with-env-vars="GIT_AUTHOR_EMAIL,GIT_AUTHOR_NAME,GIT_COMMITTER_EMAIL,GIT_COMMITTER_NAME,NX_CI_EXECUTION_ENV,NX_VERBOSE_LOGGING"
- uses: browser-actions/setup-chrome@v1
- run: chrome --version
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
cache: yarn
- name: Install NPM dependencies
run: yarn install --immutable
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{ env.JAVA_VERSION }}
cache: gradle
# We intentionally put the gradle tasks first because their artifacts are needed for project graph construction
# and we do not want to give the false impression that the artifact download time is part of nx commands.
- name: Gradle artifacts and formatting
run: |
yarn nx-cloud record -- ./gradlew projectReportAll
yarn nx-cloud record -- ./gradlew ktfmtCheck
- name: Check formatting of other files
run: yarn nx format:check --verbose
- name: Ensure the workspace configuration is in sync
run: yarn nx-cloud record -- yarn nx sync:check
- name: Run Nx Cloud conformance checks
run: yarn nx-cloud record -- yarn nx-cloud conformance:check
- run: yarn nx affected --targets=lint,test,build,e2e-ci --configuration=ci --exclude=nx-console --parallel=3
timeout-minutes: 45
main-windows:
name: Main Windows
runs-on: windows-latest
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
NX_CI_EXECUTION_ENV: 'windows'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'master'
- run: git branch --track master origin/master
if: ${{ github.event_name == 'pull_request' }}
- name: Start the Nx Cloud CI Run
run: |
yarn dlx nx-cloud start-ci-run --distribute-on="3 windows-medium-js" --with-env-vars="GIT_AUTHOR_EMAIL,GIT_AUTHOR_NAME,GIT_COMMITTER_EMAIL,GIT_COMMITTER_NAME,NX_CI_EXECUTION_ENV"
- uses: browser-actions/setup-chrome@v1
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
cache: yarn
- name: Install NPM dependencies
run: yarn install --immutable
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{ env.JAVA_VERSION }}
cache: gradle
# There's no need to check formatting & linting again on windows, sometimes there's a timing issue with intellij:build so run it up front
- run: yarn nx affected --targets="build,test,e2e-ci" --configuration=ci --exclude=nx-console --parallel=3
timeout-minutes: 45