Update to BlmapChill v0202 (Swap game, front layer; fix map details) (Closes #167) #281
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| BlmapChill: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup | |
| run: | | |
| old_commit="$(git log -3 --pretty=format:"%H" | tail -n1)" | |
| wget -O ../master.map https://github.com/DDNetPP/maps/raw/master/BlmapChill.map | |
| wget -O ../old.map "https://github.com/DDNetPP/maps/raw/$old_commit/BlmapChill.map" | |
| wget -O ../diff.sh https://raw.githubusercontent.com/lib-crash/lib-teeworlds/ffd36e74cc55dfd6f49ab08122d4a09a6a090ead/misc/mapdir_git_diff.sh | |
| chmod +x ../diff.sh | |
| cargo install twmap-tools | |
| python -m pip install --upgrade pip | |
| pip install twmap | |
| pip install numpy | |
| git clone https://github.com/DDNetPP/maps-scripts ~/scripts | |
| - name: Diff prev commit | |
| run: | | |
| twmap-edit ../old.map old --mapdir | |
| twmap-edit BlmapChill.map new --mapdir | |
| cd old || exit 1 | |
| { | |
| git config --global init.defaultBranch main | |
| git init | |
| git config --global user.email "you@example.com" | |
| git config --global user.name "Your Name" | |
| git config --global color.ui auto | |
| git add . && git commit -m "init"; | |
| } >/dev/null | |
| rm -rf * | |
| cp -r ../new/* . | |
| git --no-pager diff | |
| - name: Preview diff prev commit | |
| run: | | |
| cd old | |
| TERM=screen-256color ../../diff.sh 155 50 --buffer | |
| - name: Status prev commit | |
| run: cd old && git status | |
| - name: Diff master | |
| run: | | |
| twmap-edit ../master.map master --mapdir | |
| cd master || exit 1 | |
| { | |
| git config --global init.defaultBranch main | |
| git init | |
| git config --global user.email "you@example.com" | |
| git config --global user.name "Your Name" | |
| git config --global color.ui auto | |
| git add . && git commit -m "init"; | |
| } >/dev/null | |
| rm -rf * | |
| cp -r ../new/* . | |
| git --no-pager diff | |
| - name: Preview diff master | |
| run: | | |
| cd old | |
| TERM=screen-256color ../../diff.sh 155 50 --buffer | |
| - name: Status master | |
| run: cd old && git status | |
| - name: Check BlmpaChill version bump (top left) | |
| run: | | |
| old="$(python ~/scripts/BlmapChill/print_version.py ../old.map)" | |
| new="$(python ~/scripts/BlmapChill/print_version.py BlmapChill.map)" | |
| expected="$((old+1))" | |
| printf 'old version '%s'\n' "$old" | |
| printf 'expected version '%s'\n' "$expected" | |
| printf 'new version '%s'\n' "$new" | |
| if [ "$new" != "$expected" ] | |
| then | |
| printf 'WRONG VERSION NUMBER IN THE TOP LEFT!\n' | |
| printf ' expected: '%s'\n' "$expected" | |
| printf ' got: '%s'\n' "$new" | |
| exit 1 | |
| fi | |
| - name: Check BlmpaChill version bump (map details) | |
| run: | | |
| old="$(python ~/scripts/BlmapChill/print_map_details_version.py ../old.map)" | |
| new="$(python ~/scripts/BlmapChill/print_map_details_version.py BlmapChill.map)" | |
| expected="$((old+1))" | |
| printf 'old version '%s'\n' "$old" | |
| printf 'expected version '%s'\n' "$expected" | |
| printf 'new version '%s'\n' "$new" | |
| if [ "$new" != "$expected" ] | |
| then | |
| printf 'WRONG VERSION NUMBER IN THE MAP DETAILS!\n' | |
| printf ' expected: '%s'\n' "$expected" | |
| printf ' got: '%s'\n' "$new" | |
| exit 1 | |
| fi |