From f8ac0e4f68d38b6be95b30d98d933408fc9a09e8 Mon Sep 17 00:00:00 2001 From: Dunedan Date: Mon, 26 Aug 2024 09:39:37 +0200 Subject: [PATCH] Run checkrefs.py as Gitea Actions workflow --- .gitea/workflows/checkrefs.yml | 20 +++++++++ build/jenkins/dockerfiles/tools.Dockerfile | 13 ------ build/jenkins/pipelines/checkrefs.Jenkinsfile | 45 ------------------- 3 files changed, 20 insertions(+), 58 deletions(-) create mode 100644 .gitea/workflows/checkrefs.yml delete mode 100644 build/jenkins/dockerfiles/tools.Dockerfile delete mode 100644 build/jenkins/pipelines/checkrefs.Jenkinsfile diff --git a/.gitea/workflows/checkrefs.yml b/.gitea/workflows/checkrefs.yml new file mode 100644 index 0000000000..06c3d3eae4 --- /dev/null +++ b/.gitea/workflows/checkrefs.yml @@ -0,0 +1,20 @@ +--- +name: checkrefs +on: + - push + - pull_request +jobs: + checkrefs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install lxml + run: pip3 install lxml + - name: Workaround for authentication problem with LFS + # https://gitea.com/gitea/act_runner/issues/164 + run: git config --local http.${{ gitea.server_url }}/${{ gitea.repository }}.git/info/lfs/objects/.extraheader '' + - name: Download necessary LFS assets + run: git lfs pull -I binaries/data/mods/public/maps + - name: Check for missing references + run: ./source/tools/entity/checkrefs.py diff --git a/build/jenkins/dockerfiles/tools.Dockerfile b/build/jenkins/dockerfiles/tools.Dockerfile deleted file mode 100644 index cbfc650cf6..0000000000 --- a/build/jenkins/dockerfiles/tools.Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM python:3.12-slim-bookworm - -ARG DEBIAN_FRONTEND=noninteractive -ARG DEBCONF_NOWARNINGS="yes" -RUN apt -qq update && apt install -qqy --no-install-recommends \ - git \ - git-lfs \ - subversion \ - && apt clean - -RUN git lfs install --system --skip-smudge - -RUN pip3 install --upgrade lxml diff --git a/build/jenkins/pipelines/checkrefs.Jenkinsfile b/build/jenkins/pipelines/checkrefs.Jenkinsfile deleted file mode 100644 index 5e9f7262b2..0000000000 --- a/build/jenkins/pipelines/checkrefs.Jenkinsfile +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 2024 Wildfire Games. - * This file is part of 0 A.D. - * - * 0 A.D. is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * 0 A.D. is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with 0 A.D. If not, see . - */ - -// This pipeline runs source/tools/entity/checkrefs.py to identify -// mistakes and oversights in references to game content (assets, -// templates, etc). - -pipeline { - agent { - dockerfile { - label 'LinuxAgent' - customWorkspace 'workspace/checkrefs' - dir 'build/jenkins/dockerfiles' - filename 'tools.Dockerfile' - } - } - - stages { - stage("Asset download") { - steps { - sh "git lfs pull -I binaries/data/mods/public/maps" - } - } - - stage("Data checks") { - steps { - sh "python3 source/tools/entity/checkrefs.py -tax" - } - } - } -}