-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (89 loc) · 2.7 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
name: Main
on:
push:
branches:
- main
pull_request:
permissions:
actions: read
contents: read
jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- name: Set up source code
uses: actions/checkout@v4
- name: Run cspell
uses: streetsidesoftware/cspell-action@v5
with:
config: ".github/linters/cspell.json"
# 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
strict: true
inline: warning
verbose: false
licensecheck:
runs-on: ubuntu-latest
steps:
- name: Set up source code
uses: actions/checkout@v4
- name: Scan dependencies
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
- name: Test dependencies
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true
lintcheck:
runs-on: ubuntu-latest
steps:
- name: Set up source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Start super-linter
uses: super-linter/super-linter/slim@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GITIGNORED_FILES: true
VALIDATE_ALL_CODEBASE: false
VALIDATE_TSX: false
VALIDATE_JSX: false
VALIDATE_TYPESCRIPT_ES: false
VALIDATE_JAVASCRIPT_ES: false
main:
runs-on: ubuntu-latest
needs:
- spellcheck
- licensecheck
steps:
- name: Set up source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up pnpm
uses: pnpm/action-setup@v4
## https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
# - name: Set up task distribution
# run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"
- name: Set up nodejs
uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
cache: pnpm
- name: Set up affected modules
uses: nrwl/nx-set-shas@v4
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint, Build and Test packages
run: pnpm nx run-many --batch --targets lint build test
env:
NX_CLOUD_ACCESS_TOKEN: '${{ secrets.NX_CLOUD_ACCESS_TOKEN }}'
- name: Scan source code
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}