Skip to content

feat: support configuring unit path #359

feat: support configuring unit path

feat: support configuring unit path #359

Workflow file for this run

#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: pr-check
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
lint-format-unit:
name: linter, formatters and unit tests / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-22.04, macos-14]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Run linter
run: pnpm lint:check
- name: Run formatter
run: pnpm format:check
- name: Run unit tests
run: pnpm test:unit
- name: Run typecheck
run: pnpm typecheck
- name: Run svelte check
run: pnpm svelte:check
# Check we don't have changes in git
- name: Check no changes in git
if: ${{ matrix.os=='ubuntu-22.04'}}
run: |
if ! git diff --exit-code; then
echo "Found changes in git"
exit 1
fi
e2e-pr-check:
name: e2e tests smoke
runs-on: ubuntu-24.04
env:
SKIP_INSTALLATION: true
EXTENSION_PREINSTALLED: true
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop
steps:
- uses: actions/checkout@v4
# Set up pnpm
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
# Install Node.js
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
# Install npm packages for quadlet extension
- name: Execute pnpm in Podman Quadlet Extension
run: pnpm install --no-frozen-lockfile
# Extract @podman-desktop/api version used (and store to $GITHUB_OUTPUT)
- name: Extract @podman-desktop/api version
id: pd-api-version
run: |
# Using pnpm list to get the resolved version (E.g. getting 1.15.0 when ^1.15.0)
export PD_VERSION=$(pnpm list -C packages/backend/ --json | jq -r '.[0].devDependencies."@podman-desktop/api".version')
echo "PD_VERSION=$PD_VERSION" >> $GITHUB_OUTPUT
echo "Using @podman-desktop/api $PD_VERSION"
# Download Podman Desktop repository based on version defined in package.json
- name: Download Podman Desktop
env:
PD_VERSION: ${{ steps.pd-api-version.outputs.PD_VERSION }}
run: |
echo "Podman Desktop $PD_VERSION cache missed"
echo "Downloading PD desktop to ${{ github.workspace }}/podman-desktop"
# Stable release are available podman-desktop/podman-desktop
# Prerelease are available under podman-desktop/prereleases
if [[ "$PD_VERSION" =~ - ]]; then
wget -qO- "https://github.com/podman-desktop/prereleases/archive/refs/tags/v$PD_VERSION.tar.gz" | tar xvz
else
wget -qO- "https://github.com/podman-desktop/podman-desktop/archive/refs/tags/v$PD_VERSION.tar.gz" | tar xvz
fi
# Move the extracted folder to the podman-desktop folder
mv podman-desktop-$PD_VERSION/ podman-desktop/
# Install and build podman-desktop
- name: Install pnpm deps and build Podman Desktop
working-directory: ${{ github.workspace }}/podman-desktop
run: |
pnpm install --frozen-lockfile
pnpm test:e2e:build
- name: Update podman to 5.x
run: |
echo "ubuntu version from kubic repository to install podman we need (v5)"
ubuntu_version='23.10'
echo "Add unstable kubic repo into list of available sources and get the repo key"
sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list"
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add -
echo "install necessary dependencies for criu package which is not part of ${ubuntu_version}"
sudo apt-get install -qq libprotobuf32t64 python3-protobuf libnet1
echo "install criu manually from static location"
curl -sLO http://cz.archive.ubuntu.com/ubuntu/pool/universe/c/criu/criu_3.16.1-2_amd64.deb && sudo dpkg -i criu_3.16.1-2_amd64.deb
echo "Updating all dependencies..."
sudo apt-get update -qq
echo "installing/update podman package..."
sudo apt-get -qq -y install podman || { echo "Start fallback steps for podman nightly installation from a static mirror" && \
sudo sh -c "echo 'deb http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" && \
curl -L "http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add - && \
sudo apt-get update && \
sudo apt-get -y install podman; }
podman version
- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
run: |
# allow unprivileged user namespace
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Set cgroup_manager to 'cgroupfs' instead of systemd
run: |
mkdir -p ~/.config/containers
cat <<EOT >> ~/.config/containers/containers.conf
[engine]
cgroup_manager="cgroupfs"
EOT
podman info
- name: Build Image
id: build-image
run: |
podman build -t local_image ./
CONTAINER_ID=$(podman create localhost/local_image --entrypoint "")
mkdir -p tests/playwright/tests/playwright/output/pd-extension-quadlet-tests/plugins
podman export $CONTAINER_ID | tar -x -C tests/playwright/tests/playwright/output/pd-extension-quadlet-tests/plugins/
podman rm -f $CONTAINER_ID
podman rmi -f localhost/local_image:latest
- name: Run E2E Smoke tests
run: pnpm test:e2e:smoke
- uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-pr-check
path: ./**/tests/**/output/