MrDuartePT running Build #559
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
run-name: ${{ github.actor }} running Build | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
push: | |
branches: [ main, develop ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: ./deploy/dependencies/install_dependencies_ubuntu.sh | |
shell: bash | |
- name: Build | |
run: ./tests/test_kernel_build.sh | |
shell: bash | |
- name: Install | |
run: ./tests/test_kernel_install.sh | |
shell: bash | |
run-kernel-module-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: ./deploy/dependencies/install_dependencies_ubuntu.sh | |
shell: bash | |
- name: Test Install | |
run: ./tests/test_kernel_install.sh | |
shell: bash | |
- name: Test Reload First | |
run: ./tests/test_kernel_reload.sh | |
shell: bash | |
- name: Test Reload Second | |
run: ./tests/test_kernel_reload.sh | |
shell: bash | |
run-kernel-dkms-install-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: ./deploy/dependencies/install_dependencies_ubuntu.sh | |
shell: bash | |
- name: Build | |
run: ./tests/test_kenel_dkms_install.sh || true | |
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 | |
release-kernel-patch: | |
needs: [build, run-kernel-module-test, run-kernel-dkms-install-test, run-tests] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check if tagged | |
id: check_if_tagged | |
run: | | |
otag=$(git tag --points-at HEAD) | |
echo "Tag is ${otag}" | |
if [ -z "$otag" ] | |
then | |
hastag=0 | |
else | |
hastag=1 | |
fi | |
echo "hastag=$hastag" >> $GITHUB_OUTPUT | |
- name: Build kernel patch | |
if: steps.check_if_tagged.outputs.hastag == 1 | |
run: ./deploy/build_kernelpatch.sh | |
shell: bash | |
- name: Set tag name | |
if: steps.check_if_tagged.outputs.hastag == 1 | |
id: tag | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
echo "tag=$tag" >> $GITHUB_OUTPUT | |
tag_version=$(git describe --tags --abbrev=0 | sed 's/[^0-9.]*//g') | |
echo "tag_version=$tag_version" >> $GITHUB_OUTPUT | |
- name: Create Draft Release | |
if: steps.check_if_tagged.outputs.hastag == 1 | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.tag }} | |
release_name: ${{ steps.tag.outputs.tag }} | |
draft: true | |
prerelease: false | |
- name: Upload Release - Kernel Patch | |
if: steps.check_if_tagged.outputs.hastag == 1 | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: /tmp/linux/linux/0001-Add-legion-laptop-v${{ steps.tag.outputs.tag_version }}.patch | |
asset_name: 0001-Add-legion-laptop-v${{ steps.tag.outputs.tag_version }}.patch | |
asset_content_type: text/plain | |
- name: Publish Release | |
if: steps.check_if_tagged.outputs.hastag == 1 | |
uses: eregon/publish-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} | |
test-in-docker-container: | |
needs: [build, run-tests] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build containers and run tests inside them | |
run: ./deploy/build_containers.sh | |
shell: bash | |
build-test-commit-debs: | |
needs: [test-in-docker-container] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Check if tagged | |
id: check_if_tagged | |
run: | | |
otag=$(git tag --points-at HEAD) | |
echo "Tag is ${otag}" | |
if [ -z "$otag" ] | |
then | |
hastag=0 | |
else | |
hastag=1 | |
fi | |
echo "hastag=$hastag" >> $GITHUB_OUTPUT | |
- name: Update submodules | |
run: | | |
git submodule update --init | |
git pull --recurse-submodules | |
git submodule update --remote --recursive | |
shell: bash | |
- name: Install Dependencies | |
run: ./deploy/dependencies/install_dependencies_ubuntu.sh | |
shell: bash | |
- name: Build deb darkdetect | |
run: ./deploy/build_packages/build_deb_darkdetect.sh | |
shell: bash | |
- name: Build pkgs LenovoLegionLinux | |
run: | | |
./deploy/build_packages/build_deb_LLL.sh | |
shell: bash | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Copy and Generate files - Ubuntu | |
run: | | |
cd package_repo/ubuntu | |
gpg --armor --export "${{ secrets.GPG_ID }}" > ./KEY.gpg | |
dpkg-scanpackages --multiversion . > Packages | |
gzip -k -f Packages | |
apt-ftparchive release . > Release | |
gpg --default-key "${{ secrets.GPG_ID }}" -abs -o - Release > Release.gpg | |
gpg --default-key "${{ secrets.GPG_ID }}" --clearsign -o - Release > InRelease | |
echo "deb [signed-by=/usr/share/keyrings/lll-ppa.gpg] https://johnfanv2.github.io/LenovoLegionLinux/package_repo/ubuntu ./" > lll-ppa.list | |
shell: bash | |
- name: Commit changes | |
if: steps.check_if_tagged.outputs.hastag == 1 | |
run: | | |
git fetch | |
git add -A | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -m "Add new debs" | |
git pull --rebase | |
git push | |
shell: bash | |
build-test-commit-rpms: | |
needs: [test-in-docker-container] | |
runs-on: ubuntu-latest | |
container: | |
image: fedora:38 | |
steps: | |
- name: Install Dependencies in Container | |
run: | | |
sudo dnf install -y git kernel-headers kernel-devel dmidecode lm_sensors PyQt5 python3-yaml python3-pip python3-argcomplete polkit rpmdevtools rpmlint rpm rpm-sign | |
sudo dnf install -y dkms openssl mokutil | |
shell: bash | |
- name: Clone repo and submodules | |
uses: actions/checkout@v3 | |
with: | |
path: ./LLL | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Check if tagged | |
id: check_if_tagged | |
run: | | |
cd LLL | |
otag=$(git tag --points-at HEAD) | |
echo "Tag is ${otag}" | |
if [ -z "$otag" ] | |
then | |
hastag=0 | |
else | |
hastag=1 | |
fi | |
echo "hastag=$hastag" >> $GITHUB_OUTPUT | |
- name: Update submodules | |
run: | | |
cd LLL | |
git submodule update --init | |
git pull --recurse-submodules | |
git submodule update --remote --recursive | |
shell: bash | |
- name: Build rpm darkdetect | |
run: | | |
cd LLL | |
./deploy/build_packages/build_rpm_darkdetect.sh | |
shell: bash | |
- name: Build rpm LenovoLegionLinux | |
run: | | |
cd LLL | |
./deploy/build_packages/build_rpm_LLL.sh | |
shell: bash | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Copy and Generate files - Fedora | |
run: | | |
cd LLL | |
cd package_repo/fedora | |
gpg --armor --export "${{ secrets.GPG_ID }}" > ./pgp-key.public | |
sudo rpm --import pgp-key.public | |
echo "%_signature gpg | |
%_gpg_name Package Manager" > ~/.rpmmacros | |
rpm --addsign ./packages/*.rpm | |
cd packages | |
rm repodata/* || true | |
createrepo_c . | |
gpg --batch --detach-sign --armor repodata/repomd.xml | |
shell: bash | |
- name: Commit changes | |
if: steps.check_if_tagged.outputs.hastag == 1 | |
run: | | |
cd LLL | |
git fetch | |
git add -A | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -m "Add new rpms" | |
git pull --rebase | |
git push | |
shell: bash | |
test-packages: | |
needs: [build-test-commit-debs, build-test-commit-rpms] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build containers and run tests inside them | |
run: | | |
./deploy/package_testing/build_containers.sh | |
shell: bash |