-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.36 KB
/
Copy pathtest.yml
File metadata and controls
52 lines (43 loc) · 1.36 KB
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
name: Run Tests
on:
pull_request:
branches:
- "main"
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.ref }}
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Load dependencies
run: npm ci
- name: Format code
run: npm run format-all
- name: Add corresponding commit
if: "!contains(github.event.head_commit.message, '🎨 Code formatted')"
run: |
git config --global user.name 'OpenFoxes Maintenance Bot'
git config --global user.email 'openfoxes@bono-fox.de'
git checkout ${{ github.event.pull_request.head.ref }}
git add .
git diff-index --quiet ${{ github.event.pull_request.head.ref }} || {
git commit -m "🎨 Code formatted"
git push origin ${{ github.event.pull_request.head.ref }}
}
- name: Run all tests
run: npm run test-cov
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload scan to Sonar
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}