diff --git a/.github/actions/setup-arch/action.yml b/.github/actions/setup-arch/action.yml new file mode 100644 index 00000000..5ec58f96 --- /dev/null +++ b/.github/actions/setup-arch/action.yml @@ -0,0 +1,30 @@ +name: Set up Arch Linux +description: Install deps needed on Arch + +runs: + using: composite + steps: + - name: Get week + id: date + run: echo "week=$(date +%Y-%U)" >> $GITHUB_OUTPUT + + - name: Cache packages + uses: actions/cache@v4 + with: + path: /var/cache/pacman/pkg + key: pacman-${{ steps.date.outputs.week }}-${{ hashFiles('.github/actions/setup-arch/action.yml') }} + restore-keys: | + pacman-${{ steps.date.outputs.week }}- + pacman- + + - name: Install deps + run: | + pacman -Syu --needed --noconfirm sudo base-devel cmake ninja fish git clang qt6-declarative python + + - name: Install quickshell-git + run: | + useradd -m builder + echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + sudo -u builder git clone https://aur.archlinux.org/quickshell-git.git /home/builder/quickshell-git + cd /home/builder/quickshell-git + sudo -u builder makepkg -si --noconfirm diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml new file mode 100644 index 00000000..e404104a --- /dev/null +++ b/.github/workflows/check-format.yml @@ -0,0 +1,33 @@ +name: Check formatting + +on: + push: + branches: + - main + pull_request: + +jobs: + check-format: + runs-on: ubuntu-latest + + container: + image: archlinux:latest + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-arch + + - name: Check QML format + shell: fish {0} + run: | + for file in (string match -v 'build/*' **.qml) + /usr/lib/qt6/bin/qmlformat $file | diff -u $file - || exit 1 + end + python3 scripts/qml-lint-conventions.py + + - name: Check C++ format + shell: fish {0} + run: | + for file in (string match -v 'build/*' **.cpp **.hpp) + clang-format $file | diff -u $file - || exit 1 + end