-
Notifications
You must be signed in to change notification settings - Fork 8
73 lines (59 loc) · 1.58 KB
/
main-js.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build and Test (JS)
on:
workflow_dispatch:
push:
branches:
- main
tags:
- 'v*'
merge_group:
paths:
- 'pkg/js/**'
- 'OpenFGAParser.g4'
- 'OpenFGALexer.g4'
pull_request:
paths:
- 'pkg/js/**'
- 'OpenFGAParser.g4'
- 'OpenFGALexer.g4'
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ./pkg/js/package-lock.json
- name: Audit dependencies
run: make audit-js
- name: Run Prettier
run: make format-js
- name: Run eslint
run: make lint-js
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
scope: '@openfga'
always-auth: false
cache: 'npm'
cache-dependency-path: ./pkg/js/package-lock.json
- name: Build
run: make all-tests-js