-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (38 loc) · 1.17 KB
/
main.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
name: Test & build
on: [push, pull_request]
jobs:
main:
runs-on: ubuntu-latest
steps:
- run: sudo apt install erlang
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- name: Run Commitlint
env:
EVENT_TYPE: ${{ github.event_name }}
HEAD: ${{ github.event.pull_request.head.sha }}
BASE: ${{ github.event.pull_request.base.sha }}
run: |
if [ "$EVENT_TYPE" = "push" ]; then
npx commitlint --from HEAD~${{ github.event.push.commits }} --to HEAD --verbose
else
npx commitlint --from $BASE --to $HEAD --verbose
fi
- run: npm run lint
- run: docker compose up -d
- run: npx nyc npm run test
- run: npx nyc report --reporter=text-lcov > coverage.lcov
- uses: codecov/codecov-action@v4
with:
files: coverage.lcov
- run: docker compose logs
if: always()