0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 15:50:42 -05:00

Github Migration - Workflows & Issue Template

- Replaces the Gitea workflows with Github workflows.
- Adds a Github issue template.

(The reason this is being done directly on master is because it's the branch that the issue templates load from.)
This commit is contained in:
Refringe 2024-11-24 22:58:59 -05:00
parent 5740774a46
commit 31079e4ebf
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k
9 changed files with 192 additions and 168 deletions

View File

@ -1,35 +0,0 @@
name: Trigger Main Build Pipeline
on:
push:
tags:
- '*'
jobs:
trigger-main-build:
runs-on: ubuntu-latest
steps:
- name: Setup Git Config
run: |
git config --global user.email "noreply@sp-tarkov.com"
git config --global user.name "TriggerBot"
- name: Clone Build Repository
run: |
rm -rf ../Build
git clone https://${{ secrets.BUILD_USERNAME }}:${{ secrets.BUILD_ACCESS_TOKEN }}@dev.sp-tarkov.com/SPT/Build.git ../Build
- name: Trigger Branch
working-directory: ../Build
run: git checkout -b trigger || git checkout trigger
- name: Create Trigger File
working-directory: ../Build
run: |
echo "${GITHUB_REF_NAME}" > .gitea/trigger
git add .gitea/trigger
git commit -m "Server triggered build with tag '${GITHUB_REF_NAME}'"
- name: Force Push
working-directory: ../Build
run: git push --force origin trigger

View File

@ -1,59 +0,0 @@
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/Build/server
git clone https://dev.sp-tarkov.com/${GITHUB_REPOSITORY}.git --branch master /workspace/SPT/Build/server
cd /workspace/SPT/Build/server
git checkout ${GITHUB_SHA}
shell: bash
- name: Pull LFS Files
run: |
cd /workspace/SPT/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/Build/server/project/node_modules
key: npm-dependencies-${{ hashFiles('/workspace/SPT/Build/server/project/package.json') }}
- name: Install NPM Dependencies
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
run: |
cd /workspace/SPT/Build/server/project
rm -rf node_modules
npm install
shell: bash
- name: Run Linter
id: run-tests
run: |
cd /workspace/SPT/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, 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"
echo -e "Consistency is professionalism.™"
shell: bash

View File

@ -1,73 +0,0 @@
name: Run Tests
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
vitest:
runs-on: ubuntu-latest
if: > # Conditional to limit runs: checks if it's NOT a push to a branch with an open PR
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name != github.repository
container:
image: refringe/spt-build-node:1.0.7
steps:
- name: Clone
run: |
# For pull request events, checkout using GITHUB_SHA
# For push events, checkout using GITHUB_REF_NAME
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
REF=${GITHUB_SHA}
else
REF=${GITHUB_REF_NAME}
fi
rm -rf /workspace/SPT/Server/current
git clone https://dev.sp-tarkov.com/${{ github.repository }}.git /workspace/SPT/Server/current
cd /workspace/SPT/Server/current
git fetch
git checkout $REF
env:
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
shell: bash
- name: Pull LFS Files
run: |
cd /workspace/SPT/Server/current && ls -lah
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/Server/current/project/node_modules
key: npm-dependencies-${{ hashFiles('/workspace/SPT/Server/current/project/package.json') }}
- name: Install NPM Dependencies
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
run: |
cd /workspace/SPT/Server/current/project
rm -rf /workspace/SPT/Server/current/project/node_modules
npm install
shell: bash
- name: Run Tests
id: run-tests
run: |
cd /workspace/SPT/Server/current/project
npm run test
shell: bash
- name: Fix Instructions
if: failure() && steps.run-tests.outcome == 'failure'
run: |
echo -e "Automated tests have failed. This could point to an issue with the committed code, or an updated test that has yet to be updated. Please look into resolving these test failures. The testing suite has a GUI to aid in writing tests. You can launch this by running the following command from within the 'project' directory.\n\nnpm run test:ui\n"
echo -e "A test written today is a bug prevented tomorrow.™"
shell: bash

101
.github/issue_template/1-bug-report.yml vendored Normal file
View File

@ -0,0 +1,101 @@
name: "Bug Report"
description: "Report a bug in the SPT project."
labels: ["triage"]
body:
- type: markdown
attributes:
value: |
## Thank you for taking the time to fill out a bug report!
Please note the following requirements:
- You must be able to replicate the issue with a fresh profile, running no mods. If you can't, we can't fix it.
- If you are using a profile from an older version, please make a fresh profile and replicate the issue before submitting.
- You must upload all the required log files, even if you think they are useless.
- Failure to comply with any of the above requirements will result in your issue being closed without notice.
- type: dropdown
id: version
attributes:
label: SPT Version
description: What version of SPT are you using?
options:
- "3.10"
- "3.9"
validations:
required: true
- type: dropdown
id: projects
attributes:
label: "Project Type"
description: "If known, which part of the project is involved in this bug report?"
options:
- "Server"
- "Modules"
- "Launcher"
multiple: true
validations:
required: false
- type: textarea
id: result_expected
attributes:
label: "Expected Result"
description: "What you expect to happen?"
validations:
required: true
- type: textarea
id: result_actual
attributes:
label: "Actual Result"
description: "What actually happened?"
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: "Steps To Reproduce"
description: "Describe in point form the steps we can take to reproduce the issue on our end."
validations:
required: true
- type: textarea
id: log_server
attributes:
label: "Server Log"
description: "Upload a copy of your *entire* server log: `/user/logs/server-<date>.log`."
value: "Click and attach file. ↓"
validations:
required: true
- type: textarea
id: log_bepinex
attributes:
label: "BepinEx Log"
description: "Upload a copy of your *entire* BepinEx log: `/BepinEx/LogOutput.log`."
value: "Click and attach file. ↓"
validations:
required: true
- type: textarea
id: log_client
attributes:
label: "Client Log"
description: "Upload a copy of your *entire* client log: `/Logs/log_<date>_<version>/<date>_<version> traces.log`."
value: "Click and attach file. ↓"
validations:
required: true
- type: textarea
id: profile
attributes:
label: "Player Profile"
description: "If helpful, upload a copy of your *entire* player profile: `/user/profiles/<profileId>.json`."
validations:
required: false
- type: textarea
id: screenshots
attributes:
label: "Screenshots"
description: "If helpful, upload any screenshots or videos you think would help us identify the issue."
validations:
required: false
- type: markdown
attributes:
value: |
## BEFORE YOU SUBMIT
Ensure that your logs are attached. No logs = Issue deleted.

8
.github/issue_template/config.yml vendored Normal file
View File

@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Discord Community
url: https://discord.com/invite/Xn9msqQZan
about: Find community support through our Discord server.
- name: Github Duscussions
url: https://github.com/orgs/sp-tarkov/discussions
about: Please duscuss the project on the Github Duscussions board.

22
.github/workflows/build-trigger.yaml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Trigger Main Build Pipeline
on:
push:
tags:
- "*"
jobs:
trigger-main-build:
runs-on: ubuntu-latest
steps:
- name: Trigger Build Workflow
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.BUILD_REPO_ACCESS_TOKEN }}
repository: sp-tarkov/build
event-type: build-trigger
client-payload: |
{
"repository": "${{ github.repository }}",
"tag": "${{ github.ref_name }}"
}

View File

@ -8,7 +8,8 @@ jobs:
clear-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@v3.0.2
with:
@ -16,6 +17,7 @@ jobs:
filters: |
database:
- 'project/assets/database/**'
- name: Send Refresh Request
if: steps.filter.outputs.database == 'true'
run: curl --max-time 30 https://db.sp-tarkov.com/api/refresh

29
.github/workflows/run-lint.yaml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Run Code Linter
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
biome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-node@v4
with:
node-version-file: "project/.nvmrc"
cache: "npm"
cache-dependency-path: "project/package.json"
- name: Install NPM Dependencies
run: npm install
working-directory: ./project
- name: Run Linter
run: npm run lint
working-directory: ./project

29
.github/workflows/run-test.yaml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Run Tests
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
vitest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-node@v4
with:
node-version-file: "project/.nvmrc"
cache: "npm"
cache-dependency-path: "project/package.json"
- name: Install NPM Dependencies
run: npm install
working-directory: ./project
- name: Run Tests
run: npm run test
working-directory: ./project