-
Notifications
You must be signed in to change notification settings - Fork 5
107 lines (99 loc) · 2.75 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
# Adapted from Analog & create-t3-app.
name: CI
on:
pull_request:
branches: ['*']
merge_group:
jobs:
commitlint:
runs-on: ubuntu-latest
name: Commitlint
permissions:
actions: read
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Lint commit messages
uses: wagoid/commitlint-github-action@v5
with:
failOnWarnings: true
helpURL: https://github.com/SaulMoro/ngrx-rtk-query/blob/main/.github/CONTRIBUTING.md#-commit-message-guidelines
check-changeset:
runs-on: ubuntu-latest
name: Check Changeset
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/composite-actions/install
- name: Check and Validate Changes in /packages/ngrx-rtk-query
run: |
git fetch origin main:main
changes=$(git diff --name-only main...${{ github.sha }} | grep '^packages/ngrx-rtk-query/' || true)
if [[ -n "$changes" ]]; then
echo "Changes detected in /packages/ngrx-rtk-query: $changes"
pnpm changeset status --since origin/main
exit_status=$?
if [[ $exit_status -eq 0 ]]; then
echo "Changeset validation succeeded."
else
echo "Changeset validation failed."
fi
else
echo "No changes detected in /packages/ngrx-rtk-query"
fi
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/composite-actions/install
- name: Lint
run: pnpm affected:lint
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/composite-actions/install
- name: Validate
run: pnpm exec nx-cloud record -- pnpm format:check
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/composite-actions/install
- name: Build
run: pnpm affected:build
test:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/composite-actions/install
- name: Test
run: pnpm affected:test
e2e:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/composite-actions/install
- name: Install Playwright
run: npx playwright install --with-deps
- name: End-to-end test
run: pnpm nx affected --target=e2e-ci