From 8a2f0ce5b199da63a7b72272f3f027d0b4418538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Negrier=20Duarte?= Date: Mon, 19 Feb 2024 17:32:53 +0000 Subject: [PATCH] Use ubuntu 23.04 to run test * Reorganize other doeckerfiles * add linux-headers-azure-6.2 deb file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gonçalo Negrier Duarte --- .github/workflows/build.yml | 33 +++------------ .github/workflows/build_PR.yml | 37 +++-------------- deploy/Dockerfile.ubuntu | 13 +++--- ...d_containers.sh => build_docker_ubuntu.sh} | 2 +- deploy/dependencies/build_xwayland-ubuntu.sh | 16 -------- .../install_dependencies_ubuntu-23.04.sh | 11 +++++ ...l_development_dependencies_ubuntu-23.04.sh | 18 +++++++++ deploy/docker-compose.yaml | 24 +---------- deploy/{ => docker_testing}/Dockerfile.arch | 0 deploy/{ => docker_testing}/Dockerfile.fedora | 0 deploy/{ => docker_testing}/Dockerfile.suse | 0 deploy/docker_testing/Dockerfile.ubuntu | 40 +++++++++++++++++++ deploy/docker_testing/build_containers.sh | 5 +++ deploy/docker_testing/docker-compose.yaml | 28 +++++++++++++ deploy/package_testing/Dockerfile.ubuntu | 8 ++-- 15 files changed, 125 insertions(+), 110 deletions(-) rename deploy/{build_containers.sh => build_docker_ubuntu.sh} (75%) delete mode 100755 deploy/dependencies/build_xwayland-ubuntu.sh create mode 100755 deploy/dependencies/install_dependencies_ubuntu-23.04.sh create mode 100755 deploy/dependencies/install_development_dependencies_ubuntu-23.04.sh rename deploy/{ => docker_testing}/Dockerfile.arch (100%) rename deploy/{ => docker_testing}/Dockerfile.fedora (100%) rename deploy/{ => docker_testing}/Dockerfile.suse (100%) create mode 100644 deploy/docker_testing/Dockerfile.ubuntu create mode 100755 deploy/docker_testing/build_containers.sh create mode 100644 deploy/docker_testing/docker-compose.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19eac72..032a6f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,34 +67,13 @@ jobs: shell: bash run-tests: - name: Run Tests runs-on: ubuntu-latest steps: - - name: Check out Git repository - uses: actions/checkout@v2 - - name: Install Development Dependencies - run: ./deploy/dependencies/install_development_dependencies_ubuntu.sh - shell: bash - - name: Lint with Linux checkpath - if: always() - run: ./tests/test_kernel_checkpath.sh - shell: bash - - name: Lint with pylint - if: always() - run: ./tests/test_python.sh - shell: bash - - name: Test python CLI - if: always() - run: ./tests/test_python_cli.sh - shell: bash - - name: Test python GUI - if: always() - run: ./tests/test_python_gui.sh - shell: bash - - name: Install python package - if: always() - run: ./deploy/python_install_pip_pkg.sh - shell: bash + - name: Checkout + uses: actions/checkout@v3 + - name: Run tests (Unbuntu 23.04) + run: ./deploy/build_docker_ubuntu.sh + shell: bash release-kernel-patch: needs: [build, run-kernel-module-test, run-kernel-dkms-install-test, run-tests] @@ -163,7 +142,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Build containers and run tests inside them - run: ./deploy/build_containers.sh + run: ./deploy/docker_testing/build_containers.sh shell: bash build-test-commit-debs: diff --git a/.github/workflows/build_PR.yml b/.github/workflows/build_PR.yml index ebb7f40..8d684c9 100644 --- a/.github/workflows/build_PR.yml +++ b/.github/workflows/build_PR.yml @@ -50,40 +50,13 @@ jobs: shell: bash run-tests: - name: Run Tests runs-on: ubuntu-latest steps: - - name: Check out Git repository - uses: actions/checkout@v2 - - name: Install Development Dependencies - run: ./deploy/dependencies/install_development_dependencies_ubuntu.sh - shell: bash - - name: Install xwayland from source - run: ./deploy/dependencies/build_xwayland-ubuntu.sh - shell: bash - - name: Install xwayland-run - run: ./deploy/dependencies/install_xwayland-run.sh - shell: bash - - name: Lint with Linux checkpath - if: always() - run: ./tests/test_kernel_checkpath.sh - shell: bash - - name: Lint with pylint - if: always() - run: ./tests/test_python.sh - shell: bash - - name: Test python CLI - if: always() - run: ./tests/test_python_cli.sh - shell: bash - - name: Test python GUI - if: always() - run: ./tests/test_python_gui.sh - shell: bash - - name: Install python package - if: always() - run: ./deploy/python_install_pip_pkg.sh - shell: bash + - name: Checkout + uses: actions/checkout@v3 + - name: Run tests (Unbuntu 23.04) + run: ./deploy/build_docker_ubuntu.sh + shell: bash test-in-docker-container: needs: [build, run-tests] diff --git a/deploy/Dockerfile.ubuntu b/deploy/Dockerfile.ubuntu index a42429a..9cba40e 100644 --- a/deploy/Dockerfile.ubuntu +++ b/deploy/Dockerfile.ubuntu @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:23.04 ARG DEBIAN_FRONTEND=noninteractive # Install sudo (used in scripts that are tested) @@ -20,12 +20,11 @@ RUN apt-get install -y gcc-12 RUN mkdir /opt/LinuxLegionLaptop WORKDIR /opt/LinuxLegionLaptop -COPY ./deploy/dependencies/install_dependencies_ubuntu.sh ./deploy/dependencies/install_dependencies_ubuntu.sh -RUN deploy/dependencies/install_dependencies_ubuntu.sh +COPY ./deploy/dependencies/install_dependencies_ubuntu-23.04.sh ./deploy/dependencies/install_dependencies_ubuntu-23.04.sh +RUN deploy/dependencies/install_dependencies_ubuntu-23.04.sh COPY ./deploy/dependencies ./deploy/dependencies -RUN deploy/dependencies/install_development_dependencies_ubuntu.sh -RUN deploy/dependencies/build_xwayland-ubuntu.sh +RUN deploy/dependencies/install_development_dependencies_ubuntu-23.04.sh RUN deploy/dependencies/install_xwayland-run.sh COPY . /opt/LinuxLegionLaptop @@ -35,6 +34,6 @@ RUN tests/test_kernel_build.sh \ RUN tests/test_python_cli.sh \ && tests/test_python_gui.sh RUN deploy/python_install_pip_pkg.sh \ - && tests/test_python_cli_installed.sh \ - && tests/test_python_gui_installed.sh + && tests/test_python_cli.sh \ + && tests/test_python_gui.sh #RUN tests/test_python_run_gui_root.sh diff --git a/deploy/build_containers.sh b/deploy/build_docker_ubuntu.sh similarity index 75% rename from deploy/build_containers.sh rename to deploy/build_docker_ubuntu.sh index d2d2063..075345b 100755 --- a/deploy/build_containers.sh +++ b/deploy/build_docker_ubuntu.sh @@ -2,4 +2,4 @@ set -ex DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd ${DIR}/dependencies -sudo docker compose build --no-cache \ No newline at end of file +sudo docker compose build --no-cache diff --git a/deploy/dependencies/build_xwayland-ubuntu.sh b/deploy/dependencies/build_xwayland-ubuntu.sh deleted file mode 100755 index e44c5a4..0000000 --- a/deploy/dependencies/build_xwayland-ubuntu.sh +++ /dev/null @@ -1,16 +0,0 @@ -cd /tmp - -# Build libepoxy -git clone https://github.com/anholt/libepoxy.git -cd libepoxy -meson -Dprefix=/usr build -sudo ninja -C build/ install -cd .. - -#Build xwayland -git clone https://gitlab.freedesktop.org/xorg/xserver.git -cd xserver -meson -Dprefix=/usr -Dxorg=false -Dxwayland=true -Dxvfb=false \ - -Dxnest=false -Dxquartz=false -Dxwin=false -Ddocs=false build -sudo ninja -C build/ install -cd .. diff --git a/deploy/dependencies/install_dependencies_ubuntu-23.04.sh b/deploy/dependencies/install_dependencies_ubuntu-23.04.sh new file mode 100755 index 0000000..4a5ff21 --- /dev/null +++ b/deploy/dependencies/install_dependencies_ubuntu-23.04.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -ex +sudo apt-get update +sudo apt-get install -y make gcc linux-headers-generic build-essential git lm-sensors wget python3-yaml python3-venv python3-pip python3-wheel python3-argcomplete policykit-1 +sudo apt-get install -y dkms openssl mokutil + +cd /tmp/ +wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux-azure-6.2/linux-headers-6.2.0-1019-azure_6.2.0-1019.19~22.04.1_amd64.deb +sudo apt install -f ./linux-headers-6.2.0-1019-azure_6.2.0-1019.19~22.04.1_amd64.deb + +sudo pip install --break-system-packages PyQt6 diff --git a/deploy/dependencies/install_development_dependencies_ubuntu-23.04.sh b/deploy/dependencies/install_development_dependencies_ubuntu-23.04.sh new file mode 100755 index 0000000..916100f --- /dev/null +++ b/deploy/dependencies/install_development_dependencies_ubuntu-23.04.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -ex +DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# Needed in CI +sudo apt-get update + +# Linter +# Tools for running GUI tests headless +sudo apt-get -y -qq install \ + wget \ + pylint python3-venv python3-pip \ + xwayland weston meson + +sudo pip install --break-system-packages pyqt6-tools PyQt6 + +${DIR}/install_dependencies_ubuntu-23.04.sh +${DIR}/linux_kernel/install_checkpath.sh diff --git a/deploy/docker-compose.yaml b/deploy/docker-compose.yaml index 3e6fa29..a2b3633 100644 --- a/deploy/docker-compose.yaml +++ b/deploy/docker-compose.yaml @@ -1,28 +1,6 @@ version: "3.9" services: - legion-arch: - build: - context: .. - dockerfile: deploy/Dockerfile.arch - legion-manjaro: - build: - context: .. - dockerfile: deploy/Dockerfile.arch - args: - - "BASE_IMAGE=manjarolinux/base" - legion-fedora: - build: - context: .. - dockerfile: deploy/Dockerfile.fedora - # legion-suse: - # build: - # context: .. - # dockerfile: deploy/Dockerfile.suse - legion-ubuntu: + testing-legion-ubuntu: build: context: .. dockerfile: deploy/Dockerfile.ubuntu - ubuntu: - image: ubuntu:latest - volumes: - - "../:/app/LenovoLegionLinux" \ No newline at end of file diff --git a/deploy/Dockerfile.arch b/deploy/docker_testing/Dockerfile.arch similarity index 100% rename from deploy/Dockerfile.arch rename to deploy/docker_testing/Dockerfile.arch diff --git a/deploy/Dockerfile.fedora b/deploy/docker_testing/Dockerfile.fedora similarity index 100% rename from deploy/Dockerfile.fedora rename to deploy/docker_testing/Dockerfile.fedora diff --git a/deploy/Dockerfile.suse b/deploy/docker_testing/Dockerfile.suse similarity index 100% rename from deploy/Dockerfile.suse rename to deploy/docker_testing/Dockerfile.suse diff --git a/deploy/docker_testing/Dockerfile.ubuntu b/deploy/docker_testing/Dockerfile.ubuntu new file mode 100644 index 0000000..f6ee14b --- /dev/null +++ b/deploy/docker_testing/Dockerfile.ubuntu @@ -0,0 +1,40 @@ +FROM ubuntu:23.04 +ARG DEBIAN_FRONTEND=noninteractive + +# Install sudo (used in scripts that are tested) +RUN apt-get update && \ + apt-get -y install sudo + +# Set timezone (used by pylint) and locale +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 +RUN ln -snf /usr/share/zoneinfo/US/Central /etc/localtime && echo US/Central > /etc/timezone && \ + apt-get -y install locales tzdata && \ + sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ + locale-gen + + +RUN apt-get install -y gcc-12 + +RUN mkdir /opt/LinuxLegionLaptop +WORKDIR /opt/LinuxLegionLaptop + +COPY ./deploy/dependencies/install_dependencies_ubuntu-23.04.sh ./deploy/dependencies/install_dependencies_ubuntu-23.04.sh +RUN deploy/dependencies/install_dependencies_ubuntu-23.04.sh + +COPY ./deploy/dependencies ./deploy/dependencies +RUN deploy/dependencies/install_development_dependencies_ubuntu-23.04.sh +RUN deploy/dependencies/build_xwayland-ubuntu.sh +RUN deploy/dependencies/install_xwayland-run.sh + +COPY . /opt/LinuxLegionLaptop + +RUN tests/test_kernel_build.sh \ + && tests/test_kernel_install.sh +RUN tests/test_python_cli.sh \ + && tests/test_python_gui.sh +RUN deploy/python_install_pip_pkg.sh \ + && tests/test_python_cli_installed.sh \ + && tests/test_python_gui_installed.sh +#RUN tests/test_python_run_gui_root.sh diff --git a/deploy/docker_testing/build_containers.sh b/deploy/docker_testing/build_containers.sh new file mode 100755 index 0000000..4af5b22 --- /dev/null +++ b/deploy/docker_testing/build_containers.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -ex +DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd ${DIR}/../dependencies +sudo docker compose build --no-cache diff --git a/deploy/docker_testing/docker-compose.yaml b/deploy/docker_testing/docker-compose.yaml new file mode 100644 index 0000000..0e7e136 --- /dev/null +++ b/deploy/docker_testing/docker-compose.yaml @@ -0,0 +1,28 @@ +version: "3.9" +services: + legion-arch: + build: + context: .. + dockerfile: deploy/docker_testing/Dockerfile.arch + legion-manjaro: + build: + context: .. + dockerfile: deploy/docker_testing/Dockerfile.arch + args: + - "BASE_IMAGE=manjarolinux/base" + legion-fedora: + build: + context: .. + dockerfile: deploy/docker_testing/Dockerfile.fedora + # legion-suse: + # build: + # context: .. + # dockerfile: deploy/Dockerfile.suse + legion-ubuntu: + build: + context: .. + dockerfile: deploy/docker_testing/Dockerfile.ubuntu + ubuntu: + image: ubuntu:latest + volumes: + - "../../:/app/LenovoLegionLinux" diff --git a/deploy/package_testing/Dockerfile.ubuntu b/deploy/package_testing/Dockerfile.ubuntu index 6e1be6c..d1b0b7d 100644 --- a/deploy/package_testing/Dockerfile.ubuntu +++ b/deploy/package_testing/Dockerfile.ubuntu @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:23.04 ARG DEBIAN_FRONTEND=noninteractive # Install sudo (used in scripts that are tested) @@ -17,11 +17,11 @@ RUN ln -snf /usr/share/zoneinfo/US/Central /etc/localtime && echo US/Central > / RUN mkdir /opt/LinuxLegionLaptop WORKDIR /opt/LinuxLegionLaptop -COPY ./deploy/dependencies/install_test_dependencies_ubuntu.sh ./deploy/dependencies/install_test_dependencies_ubuntu.sh -RUN ./deploy/dependencies/install_test_dependencies_ubuntu.sh +COPY ./deploy/dependencies/install_test_dependencies_ubuntu-23.04.sh ./deploy/dependencies/install_test_dependencies_ubuntu-23.04.sh +RUN ./deploy/dependencies/install_test_dependencies_ubuntu-23.04.sh # Test: Maybe refactor to run outside of Dockerfile COPY deploy deploy COPY tests tests RUN ./deploy/package_testing/download_install_deb_ppa.sh -RUN ./tests/test_python_installed.sh \ No newline at end of file +RUN ./tests/test_python_installed.sh