687436ab8b
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
60 lines
1.9 KiB
YAML
60 lines
1.9 KiB
YAML
name: Check Code Style
|
|
|
|
on:
|
|
push:
|
|
branches: '*'
|
|
pull_request:
|
|
branches: '*'
|
|
|
|
jobs:
|
|
dprint:
|
|
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: Check Code Style
|
|
id: check-code-style
|
|
run: |
|
|
cd /workspace/SPT-AKI/Build/server/project
|
|
npm run style
|
|
shell: bash
|
|
|
|
- name: Fix Instructions
|
|
if: failure() && steps.check-code-style.outcome == 'failure'
|
|
run: |
|
|
echo -e "The code style check has failed. To fix this, please ensure your code adheres to the project's style guidelines. You can automatically format the project code by running the following command from within the 'project' directory.\n\nnpm run style: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"
|
|
echo -e "Thank you for keeping our house clean. ♥"
|
|
shell: bash
|