-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (157 loc) · 4.86 KB
/
main.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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Main
on:
push:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DEFAULT_BRANCH: main
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup rushjs
uses: ./.github/actions/setup-rush
with:
install: true
- name: Checking for missing changelogs
uses: ./.github/actions/run-rush
with:
command: change
args: --verify
spellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Running cspell
uses: streetsidesoftware/cspell-action@v2
with:
config: '.github/linters/cspell.json'
# Log progress and other information during the action execution.
verbose: true
# Determines if the action should be failed
# if any spelling issues are found.
strict: true
# Limit the files checked to the ones in the pull request or push.
# We will enabled this only if this job tooks more than 3 minutes
incremental_files_only: false
# Notification level to use with inline reporting of spelling errors.
# Allowed values are: warning, error, none
inline: warning
licensecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Scanning dependencies
uses: fossas/fossa-action@v1
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
- name: Testing dependencies
uses: fossas/fossa-action@v1
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true
lintcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Linting
## https://github.com/super-linter/super-linter#slim-image
uses: super-linter/super-linter/slim@v5
env:
DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }}
VALIDATE_ALL_CODEBASE: false
IGNORE_GITIGNORED_FILES: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YAML_CONFIG_FILE: .yamllint.yml
YAML_ERROR_ON_WARNING: true
# Disabled javascript/typescript as we have lint on rushjs
VALIDATE_JAVASCRIPT_ES: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_JSX: false
VALIDATE_TYPESCRIPT_ES: false
VALIDATE_TYPESCRIPT_STANDARD: false
VALIDATE_TSX: false
# Disabled json validation as issue #30
VALIDATE_JSON: false
# The overrided config cannot resolve to correct path
# so we disabled it for now.
# For now, we only have single project using css linter
# so we will run it manually on local.
VALIDATE_CSS: false
# For markdownlint, as it cannot exclude file from config file
# exclude reviews file because it autogen file
FILTER_REGEX_EXCLUDE: common/reviews/api/*
testing:
runs-on: ubuntu-latest
needs:
- changelog
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup rushjs
uses: ./.github/actions/setup-rush
with:
install: true
- name: Building packages
uses: ./.github/actions/run-rush
with:
command: build
- name: Testing packages
uses: ./.github/actions/run-rush
with:
command: test
- name: Testing types
uses: ./.github/actions/run-rush
with:
command: test:types
- name: Analysis packages
uses: SonarSource/sonarcloud-github-action@v1.9.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
alternative-testing:
runs-on: ubuntu-latest
strategy:
matrix:
# Support backward 'LTS' version
# and 'current' version
# https://github.com/nodejs/release#release-schedule
# https://nodejs.org/en/blog/release
node-version: [16, 18, 20]
needs:
- testing
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup rushjs
uses: ./.github/actions/setup-rush
with:
install: true
node-version: ${{ matrix.node-version }}
- name: Building packages
uses: ./.github/actions/run-rush
with:
command: build
- name: Testing packages
uses: ./.github/actions/run-rush
with:
command: test
- name: Testing types
uses: ./.github/actions/run-rush
with:
command: test:types