-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.13 KB
/
test-and-build.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
name: Run tests
on:
- workflow_dispatch
- workflow_call
- push
- pull_request
jobs:
test:
# Don't run for pull requests from this repository to avoid duplicate builds (push also triggers build).
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: "Test and Build"
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run checks
run: |
pnpm run ci:test
call_version:
if: github.ref == 'refs/heads/main'
name: "Publish or create version PR"
uses: "./.github/workflows/version.yml"
needs: test
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}