From 61d72611339d630dfc6a97f4c01f6ef2874a5a98 Mon Sep 17 00:00:00 2001 From: Cameron Brown Date: Wed, 11 Dec 2024 10:04:05 -0500 Subject: [PATCH] First test --- .github/workflows/ci.yaml | 26 ++++++++++++++++++++++++++ scripts/install.sh | 16 ++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ae0eec32e..cae6c5f1e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,6 +33,32 @@ jobs: - id: check_skip uses: fkirc/skip-duplicate-actions@v5 + ubuntu-22-test: + name: Ensure Ubuntu 22 is prohibited + runs-on: ubuntu-22.04 + needs: avoid-duplicate-ci + if: needs.avoid-duplicate-ci.outputs.should_skip != 'true' + steps: + - name: Check out code from GitHub + uses: actions/checkout@v4 + - name: Ensure install script fails + run: | + cd $GITHUB_WORKSPACE + ./scripts/install.sh && exit 1 || exit 0 + + ubuntu-24-test: + name: Ensure Ubuntu 24 is prohibited + runs-on: ubuntu-24.04 + needs: avoid-duplicate-ci + if: needs.avoid-duplicate-ci.outputs.should_skip != 'true' + steps: + - name: Check out code from GitHub + uses: actions/checkout@v4 + - name: Ensure install script fails + run: | + cd $GITHUB_WORKSPACE + ./scripts/install.sh && exit 1 || exit 0 + super-ci: name: Run tests and build docs needs: avoid-duplicate-ci diff --git a/scripts/install.sh b/scripts/install.sh index fbef4dbbe..5eddf3237 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -20,6 +20,22 @@ if [[ -z ${TERM} ]]; then clear fi +# Before even starting, check if using Ubuntu 20.04 +NAME=$(awk -F= '/^NAME/{print $2}' /etc/os-release) +VERSION=$(awk -F= '/^VERSION/{print $2}' /etc/os-release) +if [[ $NAME != *"Ubuntu"* ]]; then + printf "${Red}This script is only supported on Ubuntu (you're using: ${NAME}). Please install Ubuntu 20.04.${Res}\n" + exit 1 +fi +if [[ $VERSION != *"20.04"* ]]; then + printf "${Red}This script is only supported on Ubuntu 20.04 (you're using: ${VERSION}). Please install Ubuntu 20.04.${Res}\n" + exit 1 +fi +if [[ $(grep -i Microsoft /proc/version) ]]; then + printf "${Red}Using WSL is not supported, due to graphical issues with our simulation environment. Please dual-boot your computer, or use a virtual machine.${Res}\n" + exit 1 +fi + # Display header cat <