-
Notifications
You must be signed in to change notification settings - Fork 13
45 lines (45 loc) · 1.15 KB
/
code_quality.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
name: Run Code Quality
on:
push:
branches:
- main
paths:
- 'src/**/*.ts'
- 'mod.ts'
- 'deps.ts'
pull_request_target:
types:
- opened
- ready_for_review
branches:
- main
- prerelease
- release
jobs:
cover:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Setup Node (required for SonarCloud)
uses: actions/setup-node@v3
with:
node-version: '17.x'
registry-url: 'https://registry.npmjs.org'
- name: Setup LCOV
run: sudo apt install -y lcov
- name: Run tests and coverage
run: deno task cover
- name: Fix LCOV output for SonarCloud
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage/report.lcov
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}