From 4f97589e231d9b11abc6285fa87fbadf741c7211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Wed, 2 Oct 2024 15:42:26 -0300 Subject: [PATCH] Try to use older Linuxes. --- .github/workflows/ecode-nightly.yml | 19 ++++++++++--------- projects/linux/scripts/install_gcc.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 projects/linux/scripts/install_gcc.sh diff --git a/.github/workflows/ecode-nightly.yml b/.github/workflows/ecode-nightly.yml index 49f73f6e3..54edcb3b4 100644 --- a/.github/workflows/ecode-nightly.yml +++ b/.github/workflows/ecode-nightly.yml @@ -43,13 +43,13 @@ jobs: Builds that include most recent changes as they happen. For stable releases check the whole list of [releases](https://github.com/SpartanJ/ecode/releases). build_linux_x86_64: - name: Linux Nightly + name: Linux x86_64 Nightly needs: release strategy: matrix: config: - arch: x86_64 - container: ubuntu-20.04 + container: ubuntu-18.04 runs-on: ${{ matrix.config.container }} env: CC: gcc @@ -74,6 +74,7 @@ jobs: - name: Install dependencies run: | sudo apt-get install -y libfuse2 fuse premake4 mesa-common-dev libgl1-mesa-dev + bash projects/linux/scripts/install_gcc.sh bash projects/linux/scripts/install_sdl2.sh - name: Build ecode run: | @@ -89,14 +90,13 @@ jobs: projects/linux/ecode/ecode-linux-${{ env.INSTALL_REF }}-${{ env.RARCH }}.tar.gz build_linux_arm64: - name: Linux Nightly + name: Linux arm64 Nightly needs: release strategy: matrix: config: - arch: aarch64 - container: ubuntu-22.04 - codename: jammy + container: ubuntu-20.04 runs-on: ${{ matrix.config.container }} env: CC: gcc @@ -120,12 +120,13 @@ jobs: echo $(gcc --version) - name: Update Packages run: | + codename=$(lsb_release -cs) url="http://ports.ubuntu.com/ubuntu-ports" repos="main restricted universe multiverse" - echo "deb [arch=arm64] $url ${{ matrix.config.codename }} $repos" > arm64.list - echo "deb [arch=arm64] $url ${{ matrix.config.codename }}-updates $repos" >> arm64.list - echo "deb [arch=arm64] $url ${{ matrix.config.codename }}-security $repos" >> arm64.list - echo "deb [arch=arm64] $url ${{ matrix.config.codename }}-backports $repos" >> arm64.list + echo "deb [arch=arm64] $url $codename $repos" > arm64.list + echo "deb [arch=arm64] $url $codename-updates $repos" >> arm64.list + echo "deb [arch=arm64] $url $codename-security $repos" >> arm64.list + echo "deb [arch=arm64] $url $codename-backports $repos" >> arm64.list sudo mv arm64.list /etc/apt/sources.list.d/ sudo apt-get update sudo dpkg --add-architecture arm64 diff --git a/projects/linux/scripts/install_gcc.sh b/projects/linux/scripts/install_gcc.sh new file mode 100644 index 000000000..fbfc5d273 --- /dev/null +++ b/projects/linux/scripts/install_gcc.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Exit script on error +set -e + +# Specify the GCC version you want to install (e.g., 9, 10, 11) +GCC_VERSION=11 + +# Add the PPA for newer GCC versions +sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +sudo apt-get update + +# Install the specified GCC version and its g++ counterpart +sudo apt-get install -y gcc-$GCC_VERSION g++-$GCC_VERSION + +# Update the alternatives to set the specified GCC version as the default +sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 100 +sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION 100 +sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 100 +sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-$GCC_VERSION 100 + +# Confirm installation +gcc --version +g++ --version + +echo "GCC $GCC_VERSION installation is complete and set as the default."