-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (77 loc) · 2.25 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
env:
CI: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-CI
jobs:
main:
runs-on: ubuntu-latest
services:
kratos:
image: ghcr.io/getlarge/nestjs-ory-integration/kratos:latest
ports:
- '44330:4433'
- '44340:4434'
keto:
image: ghcr.io/getlarge/nestjs-ory-integration/keto:latest
ports:
- '44660:4466'
- '44670:4467'
hydra:
image: ghcr.io/getlarge/nestjs-ory-integration/hydra:latest
ports:
- '44440:4444'
- '44450:4445'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- uses: nrwl/nx-set-shas@v4
- uses: 8BitJonny/[email protected]
id: current-pr
- if: steps.current-pr.outputs.number != 'null' && github.ref_name != 'main'
# This line is needed for nx affected to work when CI is running on a PR
run: git branch --track main origin/main
- run: npx nx format:check
# requires kratos and keto to be running
- run: npx nx affected -t lint,test,build --parallel=3
- uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage
overwrite: true
retention-days: 1
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
needs: main
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: martinbeentjes/[email protected]
id: package-version
- uses: actions/download-artifact@v4
with:
name: coverage
path: coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.projectVersion=${{ steps.package-version.outputs.current-version}}