-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (87 loc) · 2.91 KB
/
ci-default.yml
File metadata and controls
98 lines (87 loc) · 2.91 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
name: CI default branch
on:
push:
branches: [development]
pull_request:
branches: [development]
# To auto-approve Dependabot-created PRs, the workflow needs permissions to
# modify Pull Requests
permissions:
pull-requests: write
jobs:
linting:
name: Run Linters
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "npm"
- name: Install Dependencies
run: npm ci
- name: Run all Linters
run: make ci/linting
testing:
name: Tests (${{ matrix.os }}, ${{ matrix.node-version }})
needs: linting
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [12.x, 14.x, 16.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup OS ${{ matrix.os }} - Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: make ci/coverage
- name: Prepare Coverage Result
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: OS-${{ matrix.os }}_Node-${{ matrix.node-version }}
path-to-lcov: ./src/.coverage/lcov.info
parallel: true
# If the workflow is run because of a Dependabot-created PR, automatically
# approve the PR if it is a minor/patch update of a dependency.
# This requires the completion of the ``testing`` step.
# This assumes, that Dependabot is creating its pull requests against the
# repository's default branch, which is protected and requires an actual
# approval.
dependabot:
name: Dependabot (auto approve)
needs: testing
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Update Metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Automatically approve minor and patch updates
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
finish:
name: Finish
needs: testing
runs-on: ubuntu-latest
steps:
- name: Publish Results to Coveralls.io
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./src/.coverage/lcov.info
parallel-finished: true