-
Notifications
You must be signed in to change notification settings - Fork 104
126 lines (108 loc) · 3.64 KB
/
Copy pathci.yml
File metadata and controls
126 lines (108 loc) · 3.64 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: 'CI'
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
# Superseded PR runs are pointless; master runs must finish, since Release
# triggers on their completion.
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
name: 'Lint'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
# setup-vp replaces corepack + setup-node + dependency cache: it installs
# vp (version resolved from the vite-plus range via yarn.lock), sets up
# Node and the pinned yarn, and caches the yarn store.
- name: 'Setup Vite+'
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0
with:
node-version: '24'
cache: true
run-install: false
- name: 'Install dependencies'
run: vp install --frozen-lockfile
- name: 'Format check'
run: vp fmt --check
- name: 'Lint'
run: vp lint
build:
name: 'Build'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: 'Setup Vite+'
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0
with:
node-version: '24'
cache: true
run-install: false
- name: 'Install dependencies'
run: vp install --frozen-lockfile
- name: 'Build'
run: vp run build
test:
name: 'Test (Node ${{ matrix.node-version }})'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ['lts']
steps:
- name: 'Checkout'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: 'Setup Vite+'
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0
with:
node-version: ${{ matrix.node-version }}
cache: true
run-install: false
- name: 'Install dependencies'
run: vp install --frozen-lockfile
- name: 'Test'
run:
vp test --run --coverage --reporter='github-actions' --reporter='junit'
--outputFile='./coverage/test-report.junit.xml' --reporter=default
- name: 'Upload coverage to Codecov'
if: ${{ matrix.node-version == 'lts' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/clover.xml
disable_search: true
fail_ci_if_error: true
- name: 'Upload test results to Codecov'
if: ${{ !cancelled() && matrix.node-version == 'lts' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: 'test_results'
files: coverage/test-report.junit.xml
fail_ci_if_error: true
dependabot-merge:
name: 'Dependabot automerge'
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
needs: ['test', 'build', 'lint']
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
steps:
- uses: fastify/github-action-merge-dependabot@73ec4cbb5e56df5591eae286972d5b2201ffe90f # v3.15.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}