Skip to content

Commit af03043

Browse files
committed
refactor: test new action
1 parent 8be150c commit af03043

1 file changed

Lines changed: 145 additions & 0 deletions

File tree

.github/workflows/new-ci.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: CI New
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
NX_NON_NATIVE_HASHER: true
11+
12+
jobs:
13+
format:
14+
runs-on: ubuntu-latest
15+
name: Format check
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version-file: .node-version
25+
cache: npm
26+
- name: Set base and head for Nx affected commands
27+
uses: nrwl/nx-set-shas@v4
28+
- name: Install dependencies
29+
run: npm ci
30+
- name: Check formatting of affected files
31+
run: npx nx format:check
32+
33+
lint:
34+
runs-on: ubuntu-latest
35+
name: Linter
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
- name: Set up Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version-file: .node-version
45+
cache: npm
46+
- name: Set base and head for Nx affected commands
47+
uses: nrwl/nx-set-shas@v4
48+
- name: Install dependencies
49+
run: npm ci
50+
- name: Lint affected projects
51+
run: npx nx affected -t lint --parallel=3
52+
53+
unit-test:
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
os: [ubuntu-latest, windows-latest, macos-latest]
58+
name: Unit tests
59+
runs-on: ${{ matrix.os }}
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
65+
- name: Set up Node.js
66+
uses: actions/setup-node@v4
67+
with:
68+
node-version-file: .node-version
69+
cache: npm
70+
- name: Set base and head for Nx affected commands
71+
uses: nrwl/nx-set-shas@v4
72+
- name: Install dependencies
73+
run: npm ci
74+
- name: Unit test affected projects
75+
run: npx nx affected -t unit-test --parallel=3
76+
77+
integration-test:
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
os: [ubuntu-latest, windows-latest, macos-latest]
82+
name: Integration tests
83+
runs-on: ${{ matrix.os }}
84+
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v4
87+
with:
88+
fetch-depth: 0
89+
- name: Set up Node.js
90+
uses: actions/setup-node@v4
91+
with:
92+
node-version-file: .node-version
93+
cache: npm
94+
- name: Set base and head for Nx affected commands
95+
uses: nrwl/nx-set-shas@v4
96+
- name: Install dependencies
97+
run: npm ci
98+
- name: Integration test affected projects
99+
run: npx nx affected -t int-test --parallel=3
100+
101+
e2e:
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
os: [ubuntu-latest, windows-latest, macos-latest]
106+
name: E2E tests
107+
runs-on: ${{ matrix.os }}
108+
steps:
109+
- name: Checkout repository
110+
uses: actions/checkout@v4
111+
with:
112+
fetch-depth: 0
113+
- name: Set up Node.js
114+
uses: actions/setup-node@v4
115+
with:
116+
node-version-file: .node-version
117+
cache: npm
118+
- name: Set base and head for Nx affected commands
119+
uses: nrwl/nx-set-shas@v4
120+
- name: Install dependencies
121+
run: npm ci
122+
- name: E2E test affected projects
123+
run: npx nx affected -t e2e-test --parallel=1
124+
125+
build:
126+
runs-on: ubuntu-latest
127+
name: Build
128+
steps:
129+
- name: Checkout repository
130+
uses: actions/checkout@v4
131+
with:
132+
fetch-depth: 0
133+
- name: Set up Node.js
134+
uses: actions/setup-node@v4
135+
with:
136+
node-version-file: .node-version
137+
cache: npm
138+
- name: Set base and head for Nx affected commands
139+
uses: nrwl/nx-set-shas@v4
140+
- name: Install dependencies
141+
run: npm ci
142+
- name: Build all projects # affected is not used to be able to test-releae packages
143+
run: npx nx run-many --target=build --parallel=3
144+
- name: Test-release packages
145+
run: npx pkg-pr-new publish "packages/**/dist"

0 commit comments

Comments
 (0)