-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.47 KB
/
continuous.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
---
name: continuous
on:
pull_request:
push:
branches:
- trunk
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ matrix.node-version }}
- run: npm install -g npm@latest
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test -- --verbose
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
strategy:
matrix:
node-version:
- 18.x
- 20.x
merge:
needs: build
if: ${{github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'}}
runs-on: ubuntu-latest
steps:
- id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{secrets.GITHUB_TOKEN}}"
- if: ${{steps.metadata.outputs.update-type == 'version-update:semver-major'}}
run: gh run cancel ${{github.run_id}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
run: gh pr merge --auto --squash ${{github.event.pull_request.html_url}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}