Skip to content
Closed
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
40 changes: 38 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,42 @@ permissions:
contents: read

jobs:
lint:
runs-on: [ ubuntu-latest ]
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: package.json
registry-url: https://npm.pkg.github.com
always-auth: true
cache: 'yarn'

- name: Installs dependencies
env:
GITHUB_TOKEN: ${{github.token}}
run: yarn --frozen-lockfile --prefer-offline

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # v44.0.0

- name: Run ESLint on changed files
run: |
CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -E '\.(js|ts)$' | tr '\n' ' ')
if [ -n "$CHANGED_FILES" ]; then
echo "Linting changed files: $CHANGED_FILES"
yarn eslint -c eslint.config.mjs $CHANGED_FILES
fi

build:
name: Build and test
runs-on: [ubuntu-latest]
Expand All @@ -34,7 +70,7 @@ jobs:
fetch-depth: 0
submodules: true

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: package.json
registry-url: https://npm.pkg.github.com
Expand Down Expand Up @@ -130,7 +166,7 @@ jobs:

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: package.json
registry-url: https://npm.pkg.github.com
Expand Down