From af5dd2c94c48ca270289d0a91838cd82c6b59e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Sun, 29 Jun 2025 13:15:20 +0200 Subject: [PATCH 1/2] fix: chrome/decktape install scripts --- .github/.devcontainer/chrome/install.sh | 21 ++++++++++++++++++++- .github/.devcontainer/decktape/install.sh | 19 +++++++++++++++++++ .github/.devcontainer/tinytex/install.sh | 16 ++++++++++------ 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/.github/.devcontainer/chrome/install.sh b/.github/.devcontainer/chrome/install.sh index 3f761bc..44d2098 100755 --- a/.github/.devcontainer/chrome/install.sh +++ b/.github/.devcontainer/chrome/install.sh @@ -36,12 +36,31 @@ elif [ "${USERNAME}" = "none" ] || ! id -u "${USERNAME}" >/dev/null 2>&1; then USERNAME=root fi +apt_get_update() { + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi +} + +# Checks if packages are installed and installs them if not +check_packages() { + if ! dpkg -s "$@" >/dev/null 2>&1; then + apt_get_update + apt-get -y install --no-install-recommends "$@" + fi +} + install_chrome() { - local arch="$(dpkg --print-architecture)" + local arch="$1" check_packages wget gnupg wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - echo "deb [arch=${arch}] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google.list check_packages google-chrome-stable } +install_chrome ${arch} + apt-get clean && rm -rf /var/lib/apt/lists/* + +echo "Done!" diff --git a/.github/.devcontainer/decktape/install.sh b/.github/.devcontainer/decktape/install.sh index 029844a..e1623e2 100755 --- a/.github/.devcontainer/decktape/install.sh +++ b/.github/.devcontainer/decktape/install.sh @@ -30,6 +30,21 @@ elif [ "${USERNAME}" = "none" ] || ! id -u "${USERNAME}" >/dev/null 2>&1; then USERNAME=root fi +apt_get_update() { + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi +} + +# Checks if packages are installed and installs them if not +check_packages() { + if ! dpkg -s "$@" >/dev/null 2>&1; then + apt_get_update + apt-get -y install --no-install-recommends "$@" + fi +} + install_decktape() { local version=$1 local url="https://deb.nodesource.com/setup_${version}.x " @@ -39,4 +54,8 @@ install_decktape() { npm install -g decktape } +install_decktape ${VERSION} + apt-get clean && rm -rf /var/lib/apt/lists/* + +echo "Done!" diff --git a/.github/.devcontainer/tinytex/install.sh b/.github/.devcontainer/tinytex/install.sh index 98527af..2b67fb1 100644 --- a/.github/.devcontainer/tinytex/install.sh +++ b/.github/.devcontainer/tinytex/install.sh @@ -49,12 +49,16 @@ check_packages() { fi } -echo "Installing TinyTeX..." -check_packages libfontconfig -# su "${USERNAME}" -c 'quarto install tinytex --quiet' -check_packages curl ca-certificates -su "${USERNAME}" -c 'curl -sL "https://yihui.org/tinytex/install-bin-unix.sh" | sh' -echo "TinyTeX installation complete." +install_tinytex() { + echo "Installing TinyTeX..." + check_packages libfontconfig + # su "${USERNAME}" -c 'quarto install tinytex --quiet' + check_packages curl ca-certificates + su "${USERNAME}" -c 'curl -sL "https://yihui.org/tinytex/install-bin-unix.sh" | sh' + echo "TinyTeX installation complete." +} + +install_tinytex apt-get clean && rm -rf /var/lib/apt/lists/* From 3c1980ac1e86fc276f00c9fac13be2cff8554857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Sun, 29 Jun 2025 13:24:04 +0200 Subject: [PATCH 2/2] ci: test only on release --- .github/workflows/devcontainer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 14e0858..8227baf 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -94,6 +94,7 @@ jobs: ANNOTATION_URL: ${{ github.server_url }}/${{ github.repository }} ANNOTATION_LICENSE: "MIT" - name: Test Dev Container + if: ${{ github.event_name == 'release' }} env: QUARTO_VERSION: ${{ matrix.QUARTO_VERSION }} run: |