Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
19 changes: 19 additions & 0 deletions .github/tas-check/1-get-build-url.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# Waits for Azure to be finished building, and writes the download link to /tmp/everest-pr-tas-check/download-link.txt.
# Parameter: commit SHA

set -xeo pipefail

get_build_id() {
curl 'https://dev.azure.com/EverestAPI/Everest/_apis/build/builds?definitions=3&statusFilter=completed' \
| jq -r ".value | map(select(.sourceVersion == \"${1}\")) | .[].id"
}

BUILD_ID=`get_build_id "$1"`
while [ "${BUILD_ID}" == "" ]; do
sleep 60
BUILD_ID=`get_build_id "$1"`
done

mkdir -p /tmp/everest-pr-tas-check
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
11 changes: 11 additions & 0 deletions .github/tas-check/2-1-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Installs Everest from the branch to test, CelesteTAS and the mod that is going to be TASed.
# Parameters: ID of the mod to be TASed, URL of the TAS files

set -xeo pipefail

docker build \
--build-arg "MAIN_BUILD_URL=`cat /tmp/everest-pr-tas-check/download-link.txt`" \
--build-arg "TAS_FILES_URL=$2" \
--build-arg "TAS_TO_RUN=$1" \
-t celeste .
37 changes: 37 additions & 0 deletions .github/tas-check/2-2-install-inner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# Installs Everest from the branch to test, CelesteTAS and the mod that is going to be TASed.
# Run from within the Docker image, where Celeste is installed at /home/ubuntu/celeste.

set -xeo pipefail

# download Everest
cd /home/ubuntu
curl --fail -Lo everest.zip "${MAIN_BUILD_URL}"
unzip everest.zip
rm -v everest.zip

# copy Everest files to Celeste install
mv -fv main/* celeste/
rm -rfv main

# install Everest in headless mode
cd celeste
chmod -v u+x MiniInstaller-linux
./MiniInstaller-linux headless

# download TAS files
cd ..
curl --fail -Lo t.zip "${TAS_FILES_URL}"
unzip t.zip
rm -v t.zip

# install CelesteTAS
cd celeste/Mods
curl --fail -Lo CelesteTAS.zip "https://github.com/EverestAPI/CelesteTAS-EverestInterop/releases/download/v3.45.1/CelesteTAS.zip"

# install the mod that is going to be TASed, downloaded as a bundle zip containing the mod zip
# and all of its dependencies (https://maddie480.ovh/celeste/bundle-download?id=${TAS_TO_RUN})
# for simplicity's sake, Celeste-Bundle.zip exists but is an empty zip
curl --fail -Lo t.zip "https://celestemodupdater.0x0a.de/pinned-mods/${TAS_TO_RUN}-Bundle.zip"
unzip t.zip
rm -v t.zip
14 changes: 14 additions & 0 deletions .github/tas-check/3-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Runs the requested TAS and checks the result.
# Parameter: path of the TAS to run

set -xeo pipefail

docker run \
--volume "/tmp/everest-pr-tas-check:/home/ubuntu/tas" \
--rm \
--name celeste celeste \
--sync-check-file "/home/ubuntu/$1" \
--sync-check-result /home/ubuntu/tas/result.json

[ "`jq -r '.entries[].status' /tmp/everest-pr-tas-check/result.json`" == "success" ]
5 changes: 5 additions & 0 deletions .github/tas-check/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM max480/everest:vanilla

ARG MAIN_BUILD_URL TAS_FILES_URL TAS_TO_RUN
COPY 2-2-install-inner.sh /tmp
RUN /tmp/2-2-install-inner.sh && rm /tmp/2-2-install-inner.sh
31 changes: 31 additions & 0 deletions .github/tas-check/run-locally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Builds and runs the TAS locally, calling the same scripts as the pipeline in order to test them.
# Requires Docker and jq.

if [ "$1" == "" ] || [ "$2" == "" ]; then
echo "Usage: ./run-locally.sh [Celeste|StrawberryJam2021] [commit SHA]"
exit 1
fi

set -xeo pipefail

case "$1" in
"Celeste")
TAS_URL="https://github.com/VampireFlower/CelesteTAS/archive/60b1680e61e43ec4681d7c9053d249491e0fe905.zip"
TAS_PATH="CelesteTAS-60b1680e61e43ec4681d7c9053d249491e0fe905/0 - 100%.tas"
;;

"StrawberryJam2021")
TAS_URL="https://github.com/VampireFlower/StrawberryJamTAS/archive/fc7397c26f4d15468d4a8a3e58e7cc3d62d21223.zip"
TAS_PATH="StrawberryJamTAS-fc7397c26f4d15468d4a8a3e58e7cc3d62d21223/0-SJ All Levels.tas"
;;

*)
echo "Unknown TAS: $1"
exit 1
esac

cd "`dirname "$0"`"
./1-get-build-url.sh "$2"
./2-1-install.sh "$1" "${TAS_URL}"
./3-run.sh "${TAS_PATH}"
39 changes: 39 additions & 0 deletions .github/workflows/tas-sync-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: TAS Sync Check

on:
pull_request:
branches: [dev]

jobs:
check:
strategy:
matrix:
tas:
- name: Celeste 100%
mod: Celeste
url: "https://github.com/VampireFlower/CelesteTAS/archive/60b1680e61e43ec4681d7c9053d249491e0fe905.zip"
path: "CelesteTAS-60b1680e61e43ec4681d7c9053d249491e0fe905/0 - 100%.tas"

- name: Strawberry Jam All Levels
mod: StrawberryJam2021
url: "https://github.com/VampireFlower/StrawberryJamTAS/archive/fc7397c26f4d15468d4a8a3e58e7cc3d62d21223.zip"
path: "StrawberryJamTAS-fc7397c26f4d15468d4a8a3e58e7cc3d62d21223/0-SJ All Levels.tas"

runs-on: ubuntu-latest
timeout-minutes: 60
name: ${{ matrix.tas.name }}

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Wait for Azure build on commit ${{ github.sha }}
run: cd .github/tas-check && ./1-get-build-url.sh "${{ github.sha }}"

- name: Install Everest and ${{ matrix.tas.mod }}
run: cd .github/tas-check && ./2-1-install.sh "${{ matrix.tas.mod }}" "${{ matrix.tas.url }}"

- name: Run TAS at ${{ matrix.tas.path }}
run: cd .github/tas-check && ./3-run.sh "${{ matrix.tas.path }}"