-
Notifications
You must be signed in to change notification settings - Fork 7
122 lines (106 loc) · 3.37 KB
/
app.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
name: "Webapp"
on:
push:
branches: [ '**' ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/workflows/actions/setup
with:
node-version: ${{ matrix.node-version }}
- shell: bash
run: pnpm install
--include-workspace-root
--frozen-lockfile
--filter=app...
- name: Build
shell: bash
run: pnpm nx run app:build
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/workflows/actions/setup
with:
node-version: ${{ matrix.node-version }}
- shell: bash
run: pnpm install
--include-workspace-root
--frozen-lockfile
--filter=app...
- name: "Lint"
shell: bash
run: pnpm nx run app:lint
- name: "Type check"
shell: bash
run: pnpm nx run app:type-check
- name: "Test"
shell: bash
run: pnpm nx run app:test --watchAll=false --maxWorkers=20% --coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: env.SONAR_ORGANIZATION != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_ORGANIZATION: ${{ vars.SONAR_ORGANIZATION }}
SONAR_WEBAPP_PROJECT_KEY: ${{ vars.SONAR_WEBAPP_PROJECT_KEY }}
with:
projectBaseDir: apps/app
test-lib:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [ 18, 20 ]
webapp-lib-name:
- core
- api-client
- graphql-api
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/workflows/actions/setup
with:
node-version: ${{ matrix.node-version }}
- shell: bash
run: pnpm install
--include-workspace-root
--frozen-lockfile
--filter=${{ matrix.webapp-lib-name }}...
- name: "${{ matrix.webapp-lib-name }}: Lint"
shell: bash
run: pnpm nx run ${{ matrix.webapp-lib-name }}:lint
- name: "${{ matrix.webapp-lib-name }}: Type check"
shell: bash
run: pnpm nx run ${{ matrix.webapp-lib-name }}:type-check
- name: "${{ matrix.webapp-lib-name }}: Test"
shell: bash
run: pnpm nx run ${{ matrix.webapp-lib-name }}:test --watchAll=false --maxWorkers=20% --coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: env.SONAR_ORGANIZATION != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_ORGANIZATION: ${{ vars.SONAR_ORGANIZATION }}
SONAR_WEBAPP_CORE_PROJECT_KEY: ${{ vars.SONAR_WEBAPP_CORE_PROJECT_KEY }}
SONAR_WEBAPP_API_CLIENT_PROJECT_KEY: ${{ vars.SONAR_WEBAPP_API_CLIENT_PROJECT_KEY }}
SONAR_WEBAPP_GRAPHQL_API_PROJECT_KEY: ${{ vars.SONAR_WEBAPP_CONTENTFUL_PROJECT_KEY }}
with:
projectBaseDir: "packages/${{ matrix.webapp-lib-name }}"