-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (49 loc) · 1.44 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
name: Test potential merges
on:
pull_request:
branches: [main, pre-release]
workflow_dispatch:
env:
HUSKY: 0
jobs:
check-changesets:
name: Check if changeset release
runs-on: ubuntu-latest
outputs:
status: ${{ steps.is-changeset-release.outcome }}
steps:
- name: Skip on changeset releases
if: ${{ startsWith( github.head_ref, 'changeset-release' ) }}
id: is-changeset-release
run: exit 1
continue-on-error: true
build-and-test:
name: Build and test
runs-on: ubuntu-latest
needs: check-changesets
if: needs.check-changesets.outputs.status == 'success' || needs.check-changesets.outputs.status == 'skipped'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: npm
- name: Cache
uses: actions/cache@v4
with:
path: |
/home/runner/work/packages/packages/node_modules/.cache/eslint/
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/.eslintrc.cjs') }}
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run test
conclusion:
needs: build-and-test
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- if: needs.build-and-test.result == 'failure' || needs.build-and-test.result == 'cancelled'
run: exit 1
- run: exit 0