-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (125 loc) · 4.51 KB
/
code_review.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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# This workflow will perform the code review on each code change.
# It uses "actions/cache" and turborepo in order to perform tasks only on changed files.
name: "Continuous Integration"
on:
push:
branches:
- main
paths:
- apps/**
- packages/**
- package.json
- turbo.json
- .github/workflows/code_review.yaml
- docker/**/*
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- apps/**
- packages/**
- package.json
- turbo.json
- .github/workflows/code_review.yaml
- docker/**/*
workflow_dispatch:
jobs:
code_review:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version-file: ".node-version"
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Cache turbo build setup
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Build
run: yarn build
- name: "Code review"
run: yarn code-review
# this step uses a set of filters to prevent
# additional work not needed
- uses: dorny/[email protected]
id: sonarcloud_filter
with:
filters: ./.github/ci_filters.yaml
- name: SonarCloud session-manager scan
if: steps.sonarcloud_filter.outputs.io-session-manager == 'true'
uses: SonarSource/sonarcloud-github-action@19888635fa64d24e533d388efe8264402dfd721b
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-session-manager/
- name: SonarCloud io-fast-login scan
if: steps.sonarcloud_filter.outputs.io-fast-login == 'true'
uses: SonarSource/sonarcloud-github-action@19888635fa64d24e533d388efe8264402dfd721b
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-fast-login/
- name: SonarCloud io-lollipop scan
if: steps.sonarcloud_filter.outputs.io-lollipop == 'true'
uses: SonarSource/sonarcloud-github-action@19888635fa64d24e533d388efe8264402dfd721b
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-lollipop/
- name: SonarCloud io-web-profile scan
if: steps.sonarcloud_filter.outputs.io-web-profile == 'true'
uses: SonarSource/sonarcloud-github-action@19888635fa64d24e533d388efe8264402dfd721b
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: apps/io-web-profile/
e2e:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version-file: ".node-version"
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Cache turbo build setup
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Build
run: yarn build
- name: Generate Environment
run: yarn docker:generate:env
- uses: dorny/[email protected]
id: test_filter
with:
filters: ./.github/ci_filters.yaml
- name: "io-lollipop integration Tests"
if: steps.test_filter.outputs.io-lollipop == 'true'
run: >-
yarn docker:start:build io-lollipop &&
yarn test:integrations:io-lollipop
- name: "E2E Tests"
if: steps.test_filter.outputs.io-session-manager == 'true'
run: yarn workspace e2e start