-
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (64 loc) · 2.26 KB
/
ci.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
name: CI
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
merge_group:
branches: [master]
permissions:
contents: read
checks: read
jobs:
build:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
deno: [v1.x, v2.x, canary]
name: Deno ${{ matrix.deno }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis. This is needed for better sonar
- name: Setup Deno ${{ matrix.deno }}
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.deno }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Format Check
if: ${{ matrix.os == 'ubuntu-latest' && matrix.deno == 'v2.x' }}
run: deno task format:check
- name: Lint
if: ${{ matrix.os == 'ubuntu-latest' && matrix.deno == 'v2.x' }}
run: deno task lint
- name: Tests with Coverage
run: deno task test:coverage
- name: Bundle
run: deno task bundle
- name: Coverage Report
if: ${{ matrix.os == 'ubuntu-latest' && matrix.deno == 'v2.x' }}
run: deno task coverage:report
- name: Fix Coverage Report Paths
if: ${{ matrix.os == 'ubuntu-latest' && matrix.deno == 'v2.x' }}
working-directory: ./coverage
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' lcov.info
- name: Check for SonarCloud Token Availability
id: sonar-token
shell: bash
run: |
if [ "${{ secrets.SONAR_TOKEN }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- name: SonarCloud Code Analysis
if: ${{ steps.sonar-token.outputs.available == 'true' && github.repository == 'poolifier/poolifier-web-worker' && matrix.os == 'ubuntu-latest' && matrix.deno == 'v2.x' }}
uses: sonarsource/sonarqube-scan-action@v4.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}