Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:
permissions:
contents: read

env:
NODE_VERSION: '24.x'

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16, 18, 20]
node-version: [16.x, 18.x, 20.x, 22.x, 24.x]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -48,15 +51,12 @@ jobs:
- name: Set up node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
node-version: ${{ env.NODE_VERSION }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] Shouldn't this be ${{ matrix.node-version }} ? And I believe we shouldn't have any env with a node version at the top otherwise it will override all the builds. See comment from rabbitai https://github.com/openfga/js-sdk/pull/247/files#r2269791797

cache: "npm"

- name: Install dependencies
run: npm ci

- name: Audit dependencies
run: npm audit

- name: Check for circular dependencies
run: npx madge --circular . --extensions ts,js

Expand All @@ -70,9 +70,29 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
slug: openfga/js-sdk

audit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Set up node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Audit dependencies
run: npm audit

publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build, test]
needs: [build, test, audit]
runs-on: ubuntu-latest

permissions:
Expand All @@ -87,7 +107,7 @@ jobs:
- name: Set up node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://registry.npmjs.org"
scope: "@openfga"
always-auth: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
fetch-depth: 0

- name: "Run analysis"
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
Expand Down