mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
The workaround for the authentication problems isn't necessary with the new version of the checkout action anymore.
63 lines
2.2 KiB
YAML
63 lines
2.2 KiB
YAML
---
|
|
name: checkrefs
|
|
on:
|
|
- push
|
|
- pull_request
|
|
env:
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
|
|
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
|
|
|
|
jobs:
|
|
lfscheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Fetch the base branch
|
|
run: git fetch origin ${{ env.BASE_SHA }}
|
|
|
|
- name: Check that LFS files are correctly stored as pointers
|
|
run: git-lfs fsck --pointers ${{ env.BASE_SHA }}..${{ env.HEAD_SHA }}
|
|
|
|
checkrefs:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GIT_LFS_SKIP_SMUDGE: "1"
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.11"
|
|
- name: Add remote fork origin for LFS
|
|
run: |
|
|
PR_REPO="${{ gitea.event.pull_request.head.repo.full_name || gitea.repository }}"
|
|
git remote add ${{ gitea.actor }} https://gitea.wildfiregames.com/${PR_REPO}.git
|
|
- name: Download necessary LFS assets
|
|
shell: sh {0}
|
|
run: |
|
|
git lfs pull -I binaries/data/mods/public/art/meshes,binaries/data/mods/public/maps
|
|
ORIGIN_LFS_PULL_RESULT=$?
|
|
git lfs pull ${{ gitea.actor }} \
|
|
-I binaries/data/mods/public/art/meshes,binaries/data/mods/public/maps
|
|
FORK_LFS_PULL_RESULT=$?
|
|
|
|
PR_REPO="${{ gitea.event.pull_request.head.repo.full_name || gitea.repository }}"
|
|
if [ "$ORIGIN_LFS_PULL_RESULT" = "0" ]; then
|
|
echo "SUCCESS: Found all LFS assets in the LFS storage of ${{ gitea.repository }}."
|
|
elif [ "$FORK_LFS_PULL_RESULT" = "0" ]; then
|
|
echo "SUCCESS: Found all LFS assets in the LFS storage of ${PR_REPO}."
|
|
else
|
|
echo "ERROR: Couldn't find all LFS assets in either of the LFS storages."
|
|
false;
|
|
fi
|
|
- name: Install lxml
|
|
run: pip3 install lxml
|
|
- name: Install collada
|
|
run: pip3 install "pycollada>=0.9"
|
|
- name: Check for missing references
|
|
run: |
|
|
./source/tools/entity/checkrefs.py \
|
|
--check-map-xml \
|
|
--validate-templates \
|
|
--validate-actors \
|
|
--validate-meshes
|