-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (66 loc) · 2.28 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
affected: ${{ steps.set-affected.outputs.affected }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
foundations: 'packages/foundations/**'
ui: 'packages/ui/**'
storybook: 'apps/storybook/**'
demo: 'apps/demo/**'
eslint-config: 'packages/eslint-config/**'
typescript-config: 'packages/typescript-config/**'
- id: set-affected
run: |
if [[ "${{ steps.filter.outputs.foundations }}" == "true" || \
"${{ steps.filter.outputs.ui }}" == "true" || \
"${{ steps.filter.outputs.eslint-config }}" == "true" || \
"${{ steps.filter.outputs.typescript-config }}" == "true" ]]; then
echo "affected=all" >> $GITHUB_OUTPUT
elif [[ "${{ steps.filter.outputs.storybook }}" == "true" ]]; then
echo "affected=storybook" >> $GITHUB_OUTPUT
elif [[ "${{ steps.filter.outputs.demo }}" == "true" ]]; then
echo "affected=demo" >> $GITHUB_OUTPUT
else
echo "affected=none" >> $GITHUB_OUTPUT
fi
lint-build-test:
needs: detect-changes
if: needs.detect-changes.outputs.affected != 'none'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Lint, Build, and Test All
if: needs.detect-changes.outputs.affected == 'all'
run: |
npm run lint
npm run build
npm test
- name: Lint, Build, and Test Storybook
if: needs.detect-changes.outputs.affected == 'storybook'
run: |
npm run lint -w @avinode-ds/storybook
npm run build -w @avinode-ds/storybook
npm test -w @avinode-ds/storybook
- name: Lint, Build, and Test Demo
if: needs.detect-changes.outputs.affected == 'demo'
run: |
npm run lint -w @avinode-ds/demo
npm run build -w @avinode-ds/demo
npm test -w @avinode-ds/demo