Server/.gitea/workflows/run-lint.yaml
chomp 687436ab8b update 3.9.0 with 3.8.1 changes (!289)
Co-authored-by: Refringe <me@refringe.com>
Co-authored-by: Dev <dev@dev.sp-tarkov.com>
Co-authored-by: Terkoiz <terkoiz@spt.dev>
Co-authored-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/289
2024-04-15 07:59:33 +00:00

59 lines
1.9 KiB
YAML

name: Run Code Linter
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
biome:
runs-on: ubuntu-latest
container:
image: refringe/spt-build-node:1.0.7
steps:
- name: Clone
run: |
rm -rf /workspace/SPT-AKI/Build/server
git clone https://dev.sp-tarkov.com/SPT-AKI/Server.git --branch master /workspace/SPT-AKI/Build/server
cd /workspace/SPT-AKI/Build/server
git checkout ${GITHUB_SHA}
shell: bash
- name: Pull LFS Files
run: |
cd /workspace/SPT-AKI/Build/server
git lfs pull
git lfs ls-files
shell: bash
- name: Cache NPM Dependencies
id: cache-npm-dependencies
uses: actions/cache@v4
with:
path: /workspace/SPT-AKI/Build/server/project/node_modules
key: npm-dependencies-${{ hashFiles('/workspace/SPT-AKI/Build/server/project/package.json') }}
- name: Install NPM Dependencies
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
run: |
cd /workspace/SPT-AKI/Build/server/project
rm -rf node_modules
npm install
shell: bash
- name: Run Linter
id: run-tests
run: |
cd /workspace/SPT-AKI/Build/server/project
npm run lint
shell: bash
- name: Fix Instructions
if: failure() && steps.run-tests.outcome == 'failure'
run: |
echo -e "Code linting has failed. The linter has been configured to look for coding errors, defects, and questionable patterns. Please look into resolving these errors. The linter may be able to resolve some of these issues automatically. You can launch the automatic fixer by running the following command from within the 'project' directory. Anything not resolved by running this command must be resolved manually.\n\nnpm run lint:fix\n"
echo -e "Consistency is professionalism.™"
shell: bash