Skip to content

Commit

Permalink
Alternate fix for libasound, R package install for ubuntu 22 or 24, u…
Browse files Browse the repository at this point in the history
…nit test dependencies for 22/24 (#5778)

Alternate fix for libasound

Support for installing R packages quickly on Ubuntu 24

Support for unit testing on ubuntu 24

### QA Notes

All tests should pass
  • Loading branch information
testlabauto authored Dec 17, 2024
1 parent 74611ab commit 460beec
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 24 deletions.
19 changes: 16 additions & 3 deletions .github/actions/install-r/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ runs:
curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-"$(arch)"-latest.tar.gz | sudo tar xz -C /usr/local
rig add "$R_VERSION"
- name: Configure Posit PPM for Ubuntu 22.04 with Custom HTTP User-Agent
shell: bash
run: |
echo "Configuring R to use Posit Package Manager for Jammy..."
cat <<EOF > ~/.Rprofile
options(
repos = c(RSPM = "https://packagemanager.posit.co/cran/__linux__/jammy/latest"),
HTTPUserAgent = sprintf(
"R/%s (%s) R (%s)",
getRversion(), "ubuntu-2404",
paste(getRversion(), R.version\$platform, R.version\$arch, R.version\$os)
)
)
EOF
- name: Check R Installation
shell: bash
run: |
Expand All @@ -26,8 +41,6 @@ runs:
shell: bash
run: |
echo "Installing R development packages..."
# Download a sample DESCRIPTION file if not provided
curl -s https://raw.githubusercontent.com/posit-dev/qa-example-content/main/DESCRIPTION --output DESCRIPTION
# Install development dependencies using pak
Rscript -e "if (!requireNamespace('pak', quietly = TRUE)) install.packages('pak', repos = 'https://cran.rstudio.com')"
Rscript -e "pak::local_install_dev_deps(ask = FALSE)"
Rscript -e "options(pak.install_binary = TRUE); pak::local_install_dev_deps(ask = FALSE)"
17 changes: 15 additions & 2 deletions .github/actions/setup-build-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ runs:
- name: Install Build Dependencies
shell: bash
run: |
sudo apt-get update
# Detect Ubuntu version
UBUNTU_VERSION=$(lsb_release -rs)
echo "Running on Ubuntu version: $UBUNTU_VERSION"
# Install libasound2 or libasound2t64 based on version
if [[ "$UBUNTU_VERSION" == "24.04" ]]; then
echo "Installing libasound2t64 for Ubuntu 24.04"
sudo apt-get update
sudo apt-get install -y libasound2t64
else
echo "Installing libasound2 for older Ubuntu versions"
sudo apt-get update
sudo apt-get install -y libasound2
fi
sudo apt-get install -y \
vim curl build-essential clang make cmake git \
libsodium-dev libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb \
libgtk-3-0 libgbm1 libnss3 libnspr4 libasound2 libkrb5-dev libcairo-dev \
libgtk-3-0 libgbm1 libnss3 libnspr4 libkrb5-dev libcairo-dev \
libsdl-pango-dev libjpeg-dev libgif-dev pandoc
- name: Install Node packages
Expand Down
57 changes: 40 additions & 17 deletions .github/actions/setup-unit-test-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,44 @@ runs:
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y \
libwoff1 \
libvpx7 \
libevent-2.1-7 \
libgstreamer-plugins-base1.0-0 \
libgstreamer1.0-0 \
libflite1 \
libavif13 \
libhyphen0 \
libmanette-0.2-0 \
libgl1-mesa-glx \
libx264-dev \
libgstreamer-gl1.0-0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
libgles2-mesa
UBUNTU_VERSION=$(lsb_release -rs)
echo "Detected Ubuntu version: $UBUNTU_VERSION"
if [[ "$UBUNTU_VERSION" == "24.04" ]]; then
sudo apt-get install -y \
libwoff1 \
libvpx9 \
libevent-2.1-7 \
libgstreamer-plugins-base1.0-0 \
libgstreamer1.0-0 \
libflite1 \
libavif16 \
libhyphen0 \
libmanette-0.2-0 \
libgl1-mesa-dri \
libx264-dev \
libgstreamer-gl1.0-0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
libgles2
else
sudo apt-get install -y \
libwoff1 \
libvpx7 \
libevent-2.1-7 \
libgstreamer-plugins-base1.0-0 \
libgstreamer1.0-0 \
libflite1 \
libavif13 \
libhyphen0 \
libmanette-0.2-0 \
libgl1-mesa-glx \
libx264-dev \
libgstreamer-gl1.0-0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
libgles2-mesa
fi
2 changes: 1 addition & 1 deletion .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
jobs:
unit-tests:
name: unit
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ else
ROOT=$(dirname $(dirname $(readlink -f $0)))
# --disable-dev-shm-usage: when run on docker containers where size of /dev/shm
# partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory
LINUX_EXTRA_ARGS="--disable-dev-shm-usage"
# --- Start Positron ---
LINUX_EXTRA_ARGS="--disable-dev-shm-usage --no-sandbox"
# --- End Positron ---
fi

cd $ROOT
Expand Down

0 comments on commit 460beec

Please sign in to comment.