2024-04-11 01:29:20 +02:00
name : Run Code Linter
2024-04-10 21:25:41 +02:00
on :
push :
branches : '*'
pull_request :
branches : '*'
jobs :
2024-04-11 01:29:20 +02:00
biome :
2024-04-10 21:25:41 +02:00
runs-on : ubuntu-latest
container :
2024-04-10 22:07:30 +02:00
image : refringe/spt-build-node:1.0.7
2024-04-10 21:25:41 +02:00
steps :
2024-04-10 22:30:11 +02:00
- name : Clone
run : |
rm -rf /workspace/SPT-AKI/Build/server
2024-04-22 21:41:44 +02:00
git clone https://dev.sp-tarkov.com/${GITHUB_REPOSITORY}.git --branch master /workspace/SPT-AKI/Build/server
2024-04-10 22:30:11 +02:00
cd /workspace/SPT-AKI/Build/server
2024-04-10 22:46:05 +02:00
git checkout ${GITHUB_SHA}
2024-04-10 22:30:11 +02:00
shell : bash
- name : Pull LFS Files
run : |
cd /workspace/SPT-AKI/Build/server
git lfs pull
2024-04-10 22:48:45 +02:00
git lfs ls-files
2024-04-10 22:30:11 +02:00
shell : bash
2024-04-11 00:42:58 +02:00
- 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') }}
2024-04-10 22:30:11 +02:00
- name : Install NPM Dependencies
2024-04-11 00:42:58 +02:00
if : steps.cache-npm-dependencies.outputs.cache-hit != 'true'
2024-04-10 22:30:11 +02:00
run : |
2024-04-10 22:48:45 +02:00
cd /workspace/SPT-AKI/Build/server/project
2024-04-11 00:42:58 +02:00
rm -rf node_modules
2024-04-10 22:30:11 +02:00
npm install
shell : bash
2024-04-10 21:25:41 +02:00
2024-04-11 01:29:20 +02:00
- name : Run Linter
id : run-tests
2024-04-10 22:30:11 +02:00
run : |
2024-04-10 22:48:45 +02:00
cd /workspace/SPT-AKI/Build/server/project
2024-04-11 01:29:20 +02:00
npm run lint
shell : bash
- name : Fix Instructions
if : failure() && steps.run-tests.outcome == 'failure'
run : |
2024-05-08 03:21:49 +02:00
echo -e "Code linting has failed. The linter has been configured to look for coding errors, defects, questionable patterns, and code formatting issues. 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 "To automatically format code on-save in your IDE, please install the recommended VSCode plugins listed within the 'project/Server.code-workspace' file.\n"
2024-04-11 01:47:11 +02:00
echo -e "Consistency is professionalism.™"
2024-04-10 22:30:11 +02:00
shell : bash