Skip to content

build(deps): bump actions/setup-node from 3 to 4 #69

build(deps): bump actions/setup-node from 3 to 4

build(deps): bump actions/setup-node from 3 to 4 #69

Workflow file for this run

---
name: checkrefs
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [master]
paths: [art/**, maps/**, simulation/**, '**/checkrefs.yml']
pull_request:
branches: [master]
paths: [art/**, maps/**, simulation/**, '**/checkrefs.yml']
workflow_dispatch:
jobs:
general:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v35
id: changed-files-glob
with:
separator: ','
files: |
**/maps/{random,skirmishes,scenarios}/*.{js,json,pmp,xml}
- name: Check changed file names in map folder
run: |-
IFS=$',' read -ra filesArray <<< "${{ steps.changed-files-glob.outputs.all_changed_files }}"
errorFiles=()
for file in "${filesArray[@]}"; do
[[ $(basename "${file%.*}") =~ ^[0-9a-z_]+[0-9a-z]$ ]] || errorFiles+=("$file")
done
if [ ${#errorFiles[@]} -gt 0 ]; then
echo "::error:: Regex for file names doesn't match: ${errorFiles[@]}"
exit 1
fi
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Install dependencies
run: |
npm install eslint --save-dev
npm install eslint-plugin-brace-rules --save-dev
- name: Download custom ESLint config from 0ad
run: |
curl -fLo eslintrc.json https://raw.githubusercontent.com/0ad/0ad/master/build/arclint/configs/eslintrc.json || exit 1
- name: Run reviewdog/action-eslint
uses: reviewdog/action-eslint@master
with:
fail_on_error: true
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
filter_mode: added
# 0ad's eslint config is used primarily, but we add 3 additional rules:
# https://eslint.org/docs/latest/rules/comma-dangle
# https://eslint.org/docs/latest/rules/space-infix-ops
# https://eslint.org/docs/latest/rules/no-multiple-empty-lines
eslint_flags: ". --ext .js --config eslintrc.json --rule 'comma-dangle:\
\ 1' --rule 'space-infix-ops: 1' --rule 'no-multiple-empty-lines: [warn,{max:\
\ 1,maxBOF: 0,maxEOF: 0}]'"
# this last job is the most time consuming,
# if something goes wrong before, don't run this job
checkrefs:
runs-on: ubuntu-latest
needs: [general]
steps:
- name: Get latest release tag of 0 A.D.
id: tag_name
run: |
echo "release_tag=$(curl -s https://api.github.com/repos/0ad/0ad/releases/latest | jq -r '.tag_name')" >> $GITHUB_OUTPUT
- name: Check out 0 A.D. (${{ steps.tag_name.outputs.release_tag }})
uses: actions/checkout@v4
with:
repository: 0ad/0ad
path: 0ad_directory
ref: ${{ steps.tag_name.outputs.release_tag }}
clean: true
- name: Check out community maps 2
uses: actions/checkout@v4
with:
path: community_maps_2_directory
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install lxml
- name: Run checkrefs.py
run: |-
ERRLOG="${GITHUB_WORKSPACE}/errlog.txt"
cd "$GITHUB_WORKSPACE/0ad_directory/source/tools/entity" || exit 1
python3 ./checkrefs.py -m "$GITHUB_WORKSPACE/community_maps_2_directory" -tax 2> $ERRLOG
LOG_CONTENTS=$(cat $ERRLOG)
[[ -z "$LOG_CONTENTS" ]] && exit 0
echo $LOG_CONTENTS && exit 1