Skip to content

Add job for profile installation #44

Add job for profile installation

Add job for profile installation #44

Workflow file for this run

name: CI
on:
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-24.04
strategy:
matrix:
test-case: [install-script, ubuntu-generic-profile]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true # This will initialize and update submodules
- name: Cache apt lists
id: cache-apt-lists
uses: actions/cache@v3
with:
path: /var/lib/apt/lists
key: ${{ runner.os }}-apt-lists-${{ hashFiles('.github/workflows/apt-packages.txt') }}
restore-keys: |
${{ runner.os }}-apt-lists-
- name: Cache apt archives
id: cache-apt-archives
uses: actions/cache@v3
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-archives-${{ hashFiles('.github/workflows/apt-packages.txt') }}
restore-keys: |
${{ runner.os }}-apt-archives-
- name: Set up environment
run: |
echo "Cache hit for apt lists: ${{ steps.cache-apt-lists.outputs.cache-hit }}"
echo "Cache hit for apt archives: ${{ steps.cache-apt-archives.outputs.cache-hit }}"
if [ -n "${{ steps.cache-apt-lists.outputs.cache-hit }}" ] && \
[ -n "${{ steps.cache-apt-archives.outputs.cache-hit }}" ]; then
echo "Cache hit, skipping apt-get update"
else
sudo apt-get update && sudo apt-get install -y $(cat .github/workflows/apt-packages.txt)
fi
# Allow sudo without password for the current user
echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/$USER
# Set up and start Xvfb
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x24 &
# Set up gnome environment
export XDG_RUNTIME_DIR=/run/user/$(id -u)
sudo mkdir -p $XDG_RUNTIME_DIR
sudo chown $(whoami):$(whoami) $XDG_RUNTIME_DIR
chmod 700 $XDG_RUNTIME_DIR
- name: Run tests
run: |
if [ "${{ matrix.test-case }}" == "install-script" ]; then
./install-test
elif [ "${{ matrix.test-case }}" == "ubuntu-generic-profile" ]; then
./install --profile ubuntu-generic
fi