mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
CI: Use a local GitHub Action to setup installed packages
This commit is contained in:
parent
1678f43c38
commit
5aa28c31d5
Notes:
sideshowbarker
2024-07-17 02:28:18 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/5aa28c31d5 Pull-request: https://github.com/SerenityOS/serenity/pull/24178
86
.github/actions/setup/action.yml
vendored
Normal file
86
.github/actions/setup/action.yml
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
name: 'Setup action'
|
||||
description: 'Sets up the dependencies for the CI VM'
|
||||
author: 'Andrew Kaster <akaster@serenityos.org>'
|
||||
inputs:
|
||||
os:
|
||||
description: 'Operating System to set up'
|
||||
required: true
|
||||
default: 'Linux'
|
||||
arch:
|
||||
description: 'Target Architecture to set up'
|
||||
required: false
|
||||
default: 'x86_64'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
# Set default Python to python 3.x, and set Python path such that pip install works properly
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: 'Install Dependencies'
|
||||
if: ${{ inputs.os == 'Linux' }}
|
||||
shell: bash
|
||||
run: |
|
||||
# These packages are already part of the ubuntu-22.04 image:
|
||||
# cmake libgmp-dev npm shellcheck
|
||||
# Packages below aren't.
|
||||
|
||||
set -e
|
||||
sudo apt-get purge -y clang-13 clang-14 clang-15 gcc-10 gcc-11 gcc-12
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
|
||||
sudo apt-get update
|
||||
sudo apt-get install ccache clang-18 clang++-18 lld-18 clang-format-18 ninja-build unzip qt6-base-dev qt6-tools-dev-tools libqt6svg6-dev qt6-multimedia-dev libgl1-mesa-dev libpulse-dev libssl-dev libegl1-mesa-dev
|
||||
|
||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
|
||||
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
|
||||
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
|
||||
|
||||
wget https://github.com/WebAssembly/wabt/releases/download/1.0.23/wabt-1.0.23-ubuntu.tar.gz
|
||||
tar -xzf ./wabt-1.0.23-ubuntu.tar.gz
|
||||
rm ./wabt-1.0.23-ubuntu.tar.gz
|
||||
|
||||
- name: 'Install JS dependencies'
|
||||
if: ${{ inputs.os == 'Linux' || inputs.os == 'Serenity' }}
|
||||
shell: bash
|
||||
run: sudo npm install -g prettier@2.7.1
|
||||
|
||||
- name: 'Install Python dependencies'
|
||||
if: ${{ inputs.os == 'Linux' || inputs.os == 'Serenity' }}
|
||||
shell: bash
|
||||
# The setup-python action set default python to python3.x. Note that we are not using system python here.
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 requests
|
||||
|
||||
- name: 'Install Dependencies'
|
||||
if: ${{ inputs.os == 'Serenity' }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
|
||||
sudo apt-get update
|
||||
sudo apt-get install clang-format-18 ccache e2fsprogs gcc-13 g++-13 libstdc++-13-dev libmpfr-dev libmpc-dev ninja-build optipng qemu-utils qemu-system-i386 unzip generate-ninja libegl1-mesa-dev
|
||||
|
||||
if ${{ inputs.arch == 'aarch64' }}; then
|
||||
# FIXME: Remove this when we no longer build our own Qemu binary.
|
||||
sudo apt-get install libgtk-3-dev libpixman-1-dev libsdl2-dev libslirp-dev
|
||||
fi
|
||||
|
||||
- name: Enable KVM group perms
|
||||
if: ${{ inputs.os == 'Serenity' }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
|
||||
- name: 'Install Dependencies'
|
||||
if: ${{ inputs.os == 'macOS' }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
brew install coreutils bash ninja wabt ccache unzip qt llvm@18
|
40
.github/workflows/cmake.yml
vendored
40
.github/workflows/cmake.yml
vendored
@ -42,43 +42,11 @@ jobs:
|
||||
with:
|
||||
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||
|
||||
# Set default Python to python 3.x, and set Python path such that pip install works properly
|
||||
- uses: actions/setup-python@v5
|
||||
- name: 'Set up environment'
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
# === OS SETUP ===
|
||||
|
||||
# Do we need to update the package cache first?
|
||||
# sudo apt-get update -qq
|
||||
- name: "Install Ubuntu dependencies"
|
||||
# These packages are already part of the ubuntu-22.04 image:
|
||||
# cmake libgmp-dev npm shellcheck
|
||||
# Packages below aren't.
|
||||
run: |
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-format-18 ccache e2fsprogs gcc-13 g++-13 libstdc++-13-dev libmpfr-dev libmpc-dev ninja-build optipng qemu-utils qemu-system-i386 unzip generate-ninja libegl1-mesa-dev
|
||||
if ${{ matrix.arch == 'aarch64' }}; then
|
||||
# FIXME: Remove this when we no longer build our own Qemu binary.
|
||||
sudo apt-get install libgtk-3-dev libpixman-1-dev libsdl2-dev libslirp-dev
|
||||
fi
|
||||
- name: Install JS dependencies
|
||||
run: sudo npm install -g prettier@2.7.1
|
||||
- name: Install Python dependencies
|
||||
# The setup-python action set default python to python3.x. Note that we are not using system python here.
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 requests
|
||||
- name: Check versions
|
||||
run: set +e; g++ --version; g++-13 --version; clang-format --version; clang-format-18 --version; prettier --version; python --version; python3 --version; ninja --version; flake8 --version; ccache --version; qemu-system-i386 --version; gn --version
|
||||
|
||||
- name: Enable KVM group perms
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
os: 'Serenity'
|
||||
arch: ${{ matrix.arch }}
|
||||
|
||||
# === PREPARE FOR BUILDING ===
|
||||
|
||||
|
16
.github/workflows/pvs-studio-static-analysis.yml
vendored
16
.github/workflows/pvs-studio-static-analysis.yml
vendored
@ -19,16 +19,16 @@ jobs:
|
||||
wget -q -O - https://files.pvs-studio.com/beta/etc/pubkey.txt | sudo apt-key add -
|
||||
sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.pvs-studio.com/beta/etc/viva64.list
|
||||
|
||||
- name: "Install Ubuntu dependencies"
|
||||
# These packages are already part of the ubuntu-22.04 image:
|
||||
# cmake libgmp-dev npm shellcheck
|
||||
# Packages below aren't.
|
||||
#
|
||||
- name: "Set up environment"
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
os: 'Serenity'
|
||||
arch: ${{ env.PVS_STUDIO_ANALYSIS_ARCH }}
|
||||
|
||||
- name: "Install PVS Studio"
|
||||
run: |
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-format-18 gcc-13 g++-13 libstdc++-13-dev libmpfr-dev libmpc-dev ninja-build unzip pvs-studio
|
||||
sudo apt-get install -y pvs-studio
|
||||
|
||||
- name: Check versions
|
||||
run: set +e; g++ --version; g++-13 --version; ninja --version;
|
||||
|
27
.github/workflows/serenity-js-artifacts.yml
vendored
27
.github/workflows/serenity-js-artifacts.yml
vendored
@ -14,9 +14,11 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-22.04]
|
||||
package_type: [Linux-x86_64]
|
||||
os_name: [Linux]
|
||||
include:
|
||||
- os: macos-14
|
||||
package_type: macOS-universal2
|
||||
os_name: macOS
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ matrix.os }}
|
||||
@ -26,26 +28,11 @@ jobs:
|
||||
- name: Checkout SerenityOS/serenity
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies Ubuntu
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ninja-build unzip gcc-13 g++-13
|
||||
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
||||
|
||||
- name: Install dependencies macOS
|
||||
run: |
|
||||
brew install bash ninja unzip
|
||||
if: ${{ matrix.os == 'macos-14' }}
|
||||
|
||||
- name: Check versions Ubuntu
|
||||
run: |
|
||||
ninja --version; gcc-13 --version; g++-13 --version
|
||||
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
||||
|
||||
- name: Check versions macOS
|
||||
run: |
|
||||
ninja --version; clang++ --version
|
||||
if: ${{ matrix.os == 'macos-14' }}
|
||||
- name: "Set up environment"
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
os: ${{ matrix.os_name }}
|
||||
arch: 'Lagom'
|
||||
|
||||
- name: Create build directory
|
||||
run: |
|
||||
|
@ -50,20 +50,12 @@ jobs:
|
||||
echo "sonar.python.version=3.7, 3.8, 3.9" >> ${{ github.workspace }}/sonar-project.properties
|
||||
|
||||
# === OS SETUP ===
|
||||
# TODO: Is there someway to share these steps with the cmake.yml?
|
||||
|
||||
- name: "Install Ubuntu dependencies"
|
||||
# These packages are already part of the ubuntu-22.04 image:
|
||||
# cmake libgmp-dev npm shellcheck
|
||||
# Packages below aren't.
|
||||
run: |
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-format-18 gcc-13 g++-13 libstdc++-13-dev libmpfr-dev libmpc-dev ninja-build unzip
|
||||
|
||||
- name: Check versions
|
||||
run: set +e; g++ --version; g++-13 --version; ninja --version;
|
||||
- name: "Set up environment"
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
os: 'Serenity'
|
||||
arch: ${{ env.SONAR_ANALYSIS_ARCH }}
|
||||
|
||||
- name: Prepare useful stamps
|
||||
id: stamps
|
||||
|
Loading…
Reference in New Issue
Block a user