generated from jasonkuhrt/template-typescript-lib
-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (56 loc) · 1.71 KB
/
trunk.yaml
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
name: trunk
concurrency: trunk
on:
push:
branches: [main]
jobs:
# https://github.jparrowsec.cnmunity/t/how-can-i-test-if-secrets-are-available-in-an-action/17911/10
checkNpmTokenSet:
name: Check if NPM_TOKEN secret is set
runs-on: ubuntu-latest
outputs:
isNpmTokenSet: ${{ steps.checkNpmTokenSet.outputs.isNpmTokenSet }}
steps:
- name: Check if NPM_TOKEN secret is set
id: checkNpmTokenSet
run: |
echo "isNpmTokenSet: ${{secrets.NPM_TOKEN != ''}}"
echo "::set-output name=isNpmTokenSet::${{secrets.NPM_TOKEN != ''}}"
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup environment, cache, and dependencies
uses: ./.github/actions/setup
- name: Build library
run: pnpm build
- name: Run tests
run: pnpm test
test-coverage:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment, cache, and dependencies
uses: ./.github/actions/setup
- name: Run tests with coverage
run: pnpm test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
# TODO re-enable when I get DripIP working
# release-canary:
# needs: [checkNpmTokenSet]
# if: needs.checkNpmTokenSet.outputs.isNpmTokenSet == 'true'
# runs-on: ubuntu-latest
# steps:
# - uses: prisma-labs/dripip@master
# with:
# npmToken: ${{secrets.NPM_TOKEN}}
# githubToken: ${{secrets.GITHUB_TOKEN}}