From 3e801bef24652ebbdb1026164d7bbadf4cf20b88 Mon Sep 17 00:00:00 2001 From: iLLeniumStudios <104288623+TheiLLeniumStudios@users.noreply.github.com> Date: Mon, 29 May 2023 14:50:49 +0200 Subject: [PATCH] chore(pipelines): Tekton CI pipeline for lint (#279) * chore(pipelines): Tekton CI pipeline for lint * chore(pipelines): Fix pipeline taskRef * Change name for the pipelinerun * Add secret to clone repo * Run as 0 * Use specific hash for arm64 image * Fix hash for lua lint action * Change image * feat(ui/radial): Add support for ox_lib radial menu (#268) Co-authored-by: iLLeniumStudios <104288623+TheiLLeniumStudios@users.noreply.github.com> * fix(framework/esx): Fix loadout bug (#271) Co-authored-by: iLLeniumStudios <104288623+TheiLLeniumStudios@users.noreply.github.com> * fix(cache): Set ped cache after SetPlayerPed (#292) * fix(locales): Typo in locale keys * fix(player): Armour not restoring properly * fix(cache/ped): Wait 150ms instead of setting ped cache manually * fix(playeroutfitrooms): Invalid reference to the target ped (#293) * feat(tattoos): Tattoos for Build 2802 * fix(ui): Radial menu shirt icon * fix(radialmenu): Radialmenu option not showing up for clothing rooms and player outfit rooms * feat(target): usePoly usage for targets (#295) * chore(release): Remove .tekton from release zip * feat(management/qbox): qbx-management support for BossManagedOutfits (#296) * refactor(radialmenu): Move logic to separate files for each framework (#297) * refactor(radialmenu): Move to logic separate files for each framework * refactor(client): Remove unused variable * refactor(client): Move logic to separate lua files (#300) * fix(radial): Remove check to not have redudant if statements in zones * fix(management): Nil value for args * fix(radial): qb and qbx compatibility issues * fix(esx): Loadout issue on load * fix(esx): Only restore loadout if exists * fix(outfits): Accessories disappearance (#307) * refactor: remove duplicate code * fix(outfits): Prevent disappearance of accessories fix(outfits): Prevent disappearance of accessories refactor(outfits/config): add TrackerClothingOptions * refactor(outfits/config): remove redundant passing TrackerClothingOptions to UI * refactor(config): rename item to drawable * chore: change bag to default value * Add path to workspace * Add dummy * Remove lint action * Enable fail on warnings * Disable colorized output * Remove dummy variable --------- Co-authored-by: Malcolm Keefe <27903055+Mkeefeus@users.noreply.github.com> Co-authored-by: AlfaRP <88886043+Alfita2021@users.noreply.github.com> Co-authored-by: swkeep <49286776+swkeep@users.noreply.github.com> --- .github/workflows/lint.yml | 24 ----------- .tekton/lint.yaml | 68 +++++++++++++++++++++++++++++++ .tekton/tasks/fivem-lua-lint.yaml | 6 ++- 3 files changed, 73 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/lint.yml create mode 100644 .tekton/lint.yaml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index c98084e..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Lint -on: [push, pull_request_target] -jobs: - lint: - name: Lint Resource - runs-on: self-hosted - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Lint - uses: iLLeniumStudios/fivem-lua-lint-action@v2 - with: - capture: "junit.xml" - args: "-t --formatter JUnit" - extra_libs: mysql+polyzone+ox_lib - - name: Generate Lint Report - if: always() - uses: mikepenz/action-junit-report@v3 - with: - report_paths: "**/junit.xml" - check_name: Linting Report - fail_on_failure: false diff --git a/.tekton/lint.yaml b/.tekton/lint.yaml new file mode 100644 index 0000000..487f097 --- /dev/null +++ b/.tekton/lint.yaml @@ -0,0 +1,68 @@ +--- +apiVersion: tekton.dev/v1beta1 +kind: PipelineRun +metadata: + name: illenium-appearance-lint + annotations: + pipelinesascode.tekton.dev/on-event: "[push, pull_request, pull_request_target]" + pipelinesascode.tekton.dev/on-target-branch: "[main]" + pipelinesascode.tekton.dev/max-keep-runs: "3" + pipelinesascode.tekton.dev/task: "[git-clone]" + pipelinesascode.tekton.dev/task-1: ".tekton/tasks/fivem-lua-lint.yaml" +spec: + podTemplate: + securityContext: + fsGroup: 0 + params: + - name: repo_url + value: "{{repo_url}}" + - name: revision + value: "{{revision}}" + pipelineSpec: + params: + - name: repo_url + - name: revision + tasks: + - name: fetch-repo + params: + - name: url + value: $(params.repo_url) + - name: revision + value: $(params.revision) + taskRef: + name: git-clone + workspaces: + - name: output + workspace: source + secret: + secretName: "{{ git_auth_secret }}" + - name: run-lint + runAfter: + - fetch-repo + taskRef: + name: fivem-lua-lint + params: + - name: capture + value: junit.xml + - name: args + value: -t --formatter JUnit --no-color + - name: extra_libs + value: mysql+polyzone+ox_lib + - name: paths + value: $(workspaces.source.path) + - name: fail_on_warnings + value: "true" + workspaces: + - name: source + workspace: source + workspaces: + - name: source + workspaces: + - name: source + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/.tekton/tasks/fivem-lua-lint.yaml b/.tekton/tasks/fivem-lua-lint.yaml index 41088da..c44161d 100644 --- a/.tekton/tasks/fivem-lua-lint.yaml +++ b/.tekton/tasks/fivem-lua-lint.yaml @@ -27,16 +27,20 @@ spec: - name: capture description: capture output into a file default: "" + - name: fail_on_warnings + description: should fail on luacheck warnings? + default: "false" - name: extra_libs description: extra definitions to use, in the format of a+b+c default: "" steps: - name: lint - image: ghcr.io/illeniumstudios/fivem-lua-lint-action:v2.0.0 + image: ghcr.io/illeniumstudios/fivem-lua-lint-action:v2.1.0 workingDir: $(workspaces.source.path) args: - $(params.args) - $(params.paths) - $(params.config_path) - $(params.capture) + - $(params.fail_on_warnings) - $(params.extra_libs)