Skip to content

Commit 639b0d7

Browse files
committed
Run Celeste TASes on pull requests
1 parent a26ec5a commit 639b0d7

7 files changed

Lines changed: 128 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Waits for Azure to be finished building, and writes the download link to /tmp/everest-pr-tas-check/download-link.txt.
3+
# Parameter: commit SHA
4+
5+
set -xeo pipefail
6+
7+
get_build_id() {
8+
curl 'https://dev.azure.com/EverestAPI/Everest/_apis/build/builds?definitions=3&statusFilter=completed' \
9+
| jq -r ".value | map(select(.sourceVersion == \"${1}\")) | .[].id"
10+
}
11+
12+
BUILD_ID=`get_build_id "$1"`
13+
while [ "${BUILD_ID}" == "" ]; do
14+
sleep 60
15+
BUILD_ID=`get_build_id "$1"`
16+
done
17+
18+
mkdir /tmp/everest-pr-tas-check
19+
echo -n "https://dev.azure.com/EverestAPI/Everest/_apis/build/builds/${BUILD_ID}/artifacts?artifactName=main&api-version=5.0&%24format=zip" > /tmp/everest-pr-tas-check/download-link.txt

.github/tas-check/2-1-install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# Installs Everest from the branch to test, CelesteTAS and the mod that is going to be TASed.
3+
# Parameter: mod ID of the mod to be TASed
4+
5+
set -xeo pipefail
6+
7+
docker build \
8+
--build-arg "MAIN_BUILD_URL=`cat /tmp/everest-pr-tas-check/download-link.txt`" \
9+
--build-arg "TAS_TO_RUN=$1" \
10+
-t celeste .
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
# Installs Everest from the branch to test, CelesteTAS and the mod that is going to be TASed.
3+
# Run from within the Docker image, where Celeste is installed at /home/ubuntu/celeste.
4+
5+
set -xeo pipefail
6+
7+
# download Everest
8+
cd /home/ubuntu
9+
curl --fail -Lo everest.zip "${MAIN_BUILD_URL}"
10+
unzip everest.zip
11+
rm -v everest.zip
12+
13+
# copy Everest files to Celeste install
14+
mv -fv main/* celeste/
15+
rm -rfv main
16+
17+
# install Everest in headless mode
18+
cd celeste
19+
chmod -v u+x MiniInstaller-linux
20+
./MiniInstaller-linux headless
21+
22+
# download TAS files
23+
cd ..
24+
curl --fail -Lo t.zip "https://celestemodupdater.0x0a.de/pinned-mods/TAS-Files-${TAS_TO_RUN}.zip"
25+
unzip t.zip
26+
rm -v t.zip
27+
28+
# install CelesteTAS (https://maddie480.ovh/celeste/dl?id=CelesteTAS&mirror=1)
29+
cd celeste/Mods
30+
curl --fail -Lo CelesteTAS.zip "https://celestemodupdater.0x0a.de/pinned-mods/CelesteTAS.zip"
31+
32+
# install the mod that is going to be TASed, downloaded as a bundle zip containing the mod zip
33+
# and all of its dependencies (https://maddie480.ovh/celeste/bundle-download?id=${TAS_TO_RUN})
34+
# for simplicity's sake, Celeste-Bundle.zip exists but is an empty zip
35+
curl --fail -Lo t.zip "https://celestemodupdater.0x0a.de/pinned-mods/${TAS_TO_RUN}-Bundle.zip"
36+
unzip t.zip
37+
rm -v t.zip

.github/tas-check/3-run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# Runs the requested TAS and checks the result.
3+
# Parameter: path of the TAS to run
4+
5+
set -xeo pipefail
6+
7+
docker run \
8+
--volume "/tmp/everest-pr-tas-check:/home/ubuntu/tas" \
9+
--rm \
10+
--name celeste celeste \
11+
--sync-check-file "/home/ubuntu/$1" \
12+
--sync-check-result /home/ubuntu/tas/result.json
13+
14+
[ "`jq -r '.entries.[].status' /tmp/everest-pr-tas-check/result.json`" == "success" ]

.github/tas-check/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM max480/everest:vanilla
2+
3+
ARG MAIN_BUILD_URL TAS_TO_RUN
4+
COPY 2-2-install-inner.sh /tmp
5+
RUN /tmp/2-2-install-inner.sh && rm /tmp/2-2-install-inner.sh

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: TAS Sync Check
2+
3+
on:
4+
pull_request:
5+
branches: [dev]
6+
7+
jobs:
8+
check:
9+
strategy:
10+
matrix:
11+
tas:
12+
- name: Celeste 100%
13+
mod: Celeste
14+
path: "CelesteTAS-master/0 - 100%.tas"
15+
16+
- name: Strawberry Jam All Levels
17+
mod: StrawberryJam2021
18+
path: "StrawberryJamTAS-main/0-SJ All Levels.tas"
19+
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 60
22+
name: ${{ matrix.tas.name }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Wait for Azure build on commit ${{ github.sha }}
31+
run: cd .github/tas-check && ./1-get-build-url.sh "${{ github.sha }}"
32+
33+
- name: Install Everest and ${{ matrix.tas.mod }}
34+
run: cd .github/tas-check && ./2-1-install.sh "${{ matrix.tas.mod }}"
35+
36+
- name: Run TAS at ${{ matrix.tas.path }}
37+
run: cd .github/tas-check && ./3-run.sh "${{ matrix.tas.path }}"

0 commit comments

Comments
 (0)