-
Notifications
You must be signed in to change notification settings - Fork 3
92 lines (75 loc) · 2.24 KB
/
CI.yml
File metadata and controls
92 lines (75 loc) · 2.24 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
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
name: CI
on:
pull_request:
branches: [master]
concurrency: ci-${{ github.ref }}
jobs:
dependabot:
runs-on: ubuntu-latest
steps:
- uses: P5-wrapper/setup-action@v1.0.6
with:
token: ${{ secrets.GH_TOKEN }}
- name: Run format if the PR is from the Dependabot
if: github.actor == 'dependabot[bot]'
run: pnpm --if-present format
shell: bash
- name: Commit any formatting changes
if: github.actor == 'dependabot[bot]'
uses: stefanzweifel/git-auto-commit-action@v5.0.0
with:
commit_message: Apply formatting updates
branch: ${{ github.head_ref }}
token: ${{ secrets.GH_TOKEN }}
format:
runs-on: ubuntu-latest
needs: dependabot
steps:
- uses: P5-wrapper/setup-action@v1.0.6
with:
token: ${{ secrets.GH_TOKEN }}
- name: Check formatting
run: pnpm --if-present format:check
- name: Formatting issues detected (attempting fix...)
if: ${{ failure() }}
run: pnpm --if-present format
- name: Commit fixed formatting issues
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply fixed formatting issues
branch: ${{ github.head_ref }}
lint:
runs-on: ubuntu-latest
needs: dependabot
steps:
- uses: P5-wrapper/setup-action@v1.0.6
with:
token: ${{ secrets.GH_TOKEN }}
- name: Lint
run: pnpm --if-present lint
- name: Linting issues detected (attempting fix...)
if: ${{ failure() }}
run: pnpm --if-present lint:fix
- name: Commit fixed linting issues
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply fixed linting issues
branch: ${{ github.head_ref }}
test:
runs-on: ubuntu-latest
needs: dependabot
steps:
- uses: P5-wrapper/setup-action@v1.0.6
with:
token: ${{ secrets.GH_TOKEN }}
- name: Test
run: pnpm --if-present test
build:
runs-on: ubuntu-latest
needs: dependabot
steps:
- uses: P5-wrapper/setup-action@v1.0.6
with:
token: ${{ secrets.GH_TOKEN }}
- name: Build
run: pnpm build