Skip to content

Commit

Permalink
Merge pull request #100 from Alexhuszagh/actions
Browse files Browse the repository at this point in the history
Use Github actions to validate our code.
  • Loading branch information
Alexhuszagh authored Sep 7, 2024
2 parents 1d02632 + 6e28e67 commit e3b3fe7
Show file tree
Hide file tree
Showing 30 changed files with 1,506 additions and 409 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/configure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Configure

on: [push, pull_request]

jobs:
theme-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install PySide2 PySide6 PyQt5 PyQt6
- name: Checking our configuration scripts.
run: |
scripts/configure.sh
76 changes: 76 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Linters

on: [push, pull_request]

jobs:
lint-version-python:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint flake8 pyright
- name: Analysing the code with pylint
run: |
scripts/lint.sh
lint-os-python:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint flake8 pyright
- name: Analysing the code with pylint
run: |
scripts/lint.sh
lint-cpp:
strategy:
matrix:
os: [ubuntu-latest, windows-latest] # TODO: Restore macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install clang-tidy
- name: Analysing the code with clang-tidy
shell: bash
run: |
set -eux pipefail
# Windows oddly requires C++20 support due to internal bugs.
if [[ "${RUNNER_OS}" == "Windows" ]]; then
extra_args="-extra-arg=-std=c++20"
passthrough=""
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
# NOTE: The search paths aren't added by default, and we need C then C++ by default
# for our search. This makes the process easier.
extra_args="-extra-arg=-std=c++17 -extra-arg=--stdlib=libc++"
location="$(xcrun --show-sdk-path)"
passthrough="-I${location}/usr/include/c++/v1 -I${location}/usr/include"
else
extra_args="-extra-arg=-std=c++17"
passthrough=""
fi
clang-tidy -checks=-*,clang-analyzer-*,-clang-analyzer-cplusplus* ${extra_args} example/breeze_theme.hpp -- ${passthrough}
59 changes: 59 additions & 0 deletions .github/workflows/theme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Theme

on: [push, pull_request]

jobs:
theme-python:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
if [[ "${RUNNER_OS}" == "Windows" ]]; then
python -m pip install winrt-Windows.UI.ViewManagement winrt-Windows.UI
fi
- name: Checking our Python imports.
run: |
scripts/theme.sh
theme-cpp:
strategy:
matrix:
os: [ubuntu-latest] # TODO: Restore macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Checking our C++ theme detection.
shell: bash
run: |
mkdir -p dist
cd dist
if [[ "${RUNNER_OS}" == "macOS" ]]; then
clang++ ../scripts/test_theme.cpp -o test_theme -std=c++17
./test_theme
else
g++ ../scripts/test_theme.cpp -o test_theme -std=c++17
./test_theme
fi
theme-cpp-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Checking our C++ theme detection.
run: |
mkdir dist -ErrorAction SilentlyContinue
cd dist
cl ..\scripts\test_theme.cpp /std:c++17 /EHsc /link Advapi32.lib OleAut32.lib
.\test_theme.exe
27 changes: 27 additions & 0 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Ui

on: [workflow_dispatch]

jobs:
ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install PySide2 PySide6 PyQt5 PyQt6
sudo apt-get update
sudo apt-get install xvfb
sudo apt-get install build-essential libgl1-mesa-dev libgstreamer-gl1.0-0 libpulse-dev \
libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \
libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 \
libxcb-xinerama0 libxcb1 libxkbcommon-dev libxkbcommon-x11-0 libxcb-xkb-dev
- name: Checking our Python imports.
run: |
scripts/headless.sh
Loading

0 comments on commit e3b3fe7

Please sign in to comment.