Skip to content

Commit

Permalink
Use ubuntu 23.04 to run test
Browse files Browse the repository at this point in the history
* Reorganize other doeckerfiles
* add linux-headers-azure-6.2 deb files

Signed-off-by: Gonçalo Negrier Duarte <[email protected]>
  • Loading branch information
MrDuartePT committed Feb 19, 2024
1 parent 37c7091 commit 2d41c51
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 111 deletions.
33 changes: 6 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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:
Expand Down
37 changes: 5 additions & 32 deletions .github/workflows/build_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
15 changes: 7 additions & 8 deletions deploy/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:23.04
ARG DEBIAN_FRONTEND=noninteractive

# Install sudo (used in scripts that are tested)
Expand All @@ -15,17 +15,16 @@ RUN ln -snf /usr/share/zoneinfo/US/Central /etc/localtime && echo US/Central > /
locale-gen


RUN apt-get install -y gcc-12
RUN apt-get install -y gcc-11

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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -ex
DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd ${DIR}/dependencies
sudo docker compose build --no-cache
sudo docker compose build --no-cache
16 changes: 0 additions & 16 deletions deploy/dependencies/build_xwayland-ubuntu.sh

This file was deleted.

16 changes: 16 additions & 0 deletions deploy/dependencies/install_dependencies_ubuntu-23.04.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/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-azure-6.2-headers-6.2.0-1019_6.2.0-1019.19~22.04.1_all.deb

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-azure-6.2-headers-6.2.0-1019_6.2.0-1019.19~22.04.1_all.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
Original file line number Diff line number Diff line change
@@ -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
24 changes: 1 addition & 23 deletions deploy/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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"
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions deploy/docker_testing/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions deploy/docker_testing/build_containers.sh
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions deploy/docker_testing/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 4 additions & 4 deletions deploy/package_testing/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:23.04
ARG DEBIAN_FRONTEND=noninteractive

# Install sudo (used in scripts that are tested)
Expand All @@ -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
RUN ./tests/test_python_installed.sh

0 comments on commit 2d41c51

Please sign in to comment.