-
-
Notifications
You must be signed in to change notification settings - Fork 9
64 lines (51 loc) · 1.73 KB
/
test.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
53
54
55
56
57
58
59
60
61
62
63
64
name: "build-test"
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
action-is-pristine: # make sure nothing changes in the action.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/actions/public/setup-node-pnpm@v1
- run: pnpm i
- run: git --no-pager diff --compact-summary --exit-code
clean-build: # make sure nothing changes with a clean build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/actions/public/setup-node-pnpm@v1
- run: pnpm i
# Ensure the repository is clean after build
- run: pnpm clean-build
# test TypeScript build
- run: |
cd action-src
pnpm build:tsc
- run: git --no-pager diff --compact-summary --exit-code
coverage: # run coverage and unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: streetsidesoftware/actions/public/setup-node-pnpm@v1
- run: pnpm i
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: GITHUB_OUTPUT="" pnpm coverage
- name: Upload coverage Coveralls
uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # 2.3.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./action-src/coverage/lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: "./action-src"
files: ./coverage/lcov.info