-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (43 loc) · 1.36 KB
/
sdk.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
name: SDK CI
on: [ push, pull_request ]
jobs:
sdk-checks:
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run npm Install
run: npm install
- name: Unit Tests
run: npm run test
# Checks code formatting, fails if there are changes after applying prettier.
# Based on this example here:
# https://github.com/creyD/prettier_action?tab=readme-ov-file#example-4-dry-run
prettier:
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
- name: Prettify code
uses: creyD/[email protected]
with:
# "dry" causes that if any file is modified, the job fails
dry: True
# "write" performs changes in place
prettier_options: --write **/*.js **/*.ts **/*.tsx
github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}