Skip to content

Commit

Permalink
Changes to GitHub Actions (#122)
Browse files Browse the repository at this point in the history
- Uses a single action for build and check.
- Removes stable artifact building.
- Renames nightly to just "build".
- Now will include i18n into checks.
- Now will include gsettings schema, desktop and appstream in checks.
  • Loading branch information
danirod authored Feb 15, 2025
2 parents acdf6c0 + 7082f13 commit e1b328b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 57 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/nightly.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 the Cartero authors
# Copyright 2024-2025 the Cartero authors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -19,14 +19,16 @@ on:
push:
branches:
- trunk
- 'fix/*'
- 'release/*'
name: Nightly build
pull_request:
branches:
- trunk
name: Build
jobs:
flatpak:
runs-on: ubuntu-latest
if: false # disabled until https://github.com/flatpak/flatpak-github-actions/issues/214 is fixed
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-46
image: bilelmoussaoui/flatpak-github-actions:gnome-47
options: --privileged
strategy:
matrix:
Expand Down
75 changes: 46 additions & 29 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 the Cartero authors
# Copyright 2024-2025 the Cartero authors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -24,33 +24,50 @@ on:
- trunk
name: Check
jobs:
test:
name: Test
check:
name: Check
runs-on: ubuntu-24.04
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y --no-install-recommends gettext meson libgtk-4-dev libadwaita-1-dev libgtksourceview-5-dev desktop-file-utils xvfb
- uses: actions/checkout@v4
- name: Build with Meson
run: |
meson setup build
ninja -C build
- name: Test
run: CARGO_HOME=build/cargo-home xvfb-run cargo test
- name: Clippy
run: CARGO_HOME=build/cargo-home cargo clippy
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y --no-install-recommends gettext meson libgtk-4-dev libadwaita-1-dev libgtksourceview-5-dev desktop-file-utils xvfb
- uses: actions/checkout@v4
- name: Build with Meson
run: |
meson setup build
ninja -C build
- name: Format
run: cargo fmt -- --check
- name: Blueprint
run: subprojects/blueprint-compiler/blueprint-compiler.py format data/ui
- name: sccache
uses: mozilla-actions/[email protected]
- name: dependencies
run: sudo apt update && sudo apt install -y --no-install-recommends gettext meson libgtk-4-dev libadwaita-1-dev libgtksourceview-5-dev desktop-file-utils xvfb
- name: clone
uses: actions/checkout@v4
- name: setup
run: meson setup build
- name: blueprint
run: subprojects/blueprint-compiler/blueprint-compiler.py format data/ui
- name: build
run: ninja -C build
- name: linguas
run: |
for lang in $(cat po/LINGUAS | grep -E '^[a-z]{2,3}$')
do
b=$a
a=$lang
if [[ "$a" < "$b" ]]; then
echo "po/LINGUAS is not sorted alphabetically: $lang"
exit 1
fi
done
- name: update-po-check
run: |
ninja -C build cartero-update-po
! git -c core.pager="" diff -U0 po | grep -v '^@@' | grep 'msgid'
git checkout -- po
- name: cargo-fmt
run: meson devenv -C build cargo fmt --manifest-path=../Cargo.toml --check --all
- name: cargo-test
run: xvfb-run meson devenv -C build cargo test --manifest-path=../Cargo.toml
- name: cargo-clippy
run: meson devenv -C build cargo clippy --manifest-path=../Cargo.toml
- name: glib-schema
run: glib-compile-schemas --dry-run --strict data
- name: glib-desktop
run: meson devenv -C build desktop-file-validate data/es.danirod.Cartero.desktop
- name: glib-appstream
run: meson devenv -C build appstreamcli validate data/es.danirod.Cartero.appdata.xml
20 changes: 0 additions & 20 deletions build-aux/appimage-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,6 @@ case "$1" in
;;
esac

# This script is currently only tested for GitHub Actions.
if [ -z "$GITHUB_ACTIONS" ]; then
echo "WARNING! This script has only been tested to run in GitHub Actions and"
echo "it is used to build the stable and nightly versions in a well known"
echo "environment. Running this script to create an AppImage on your computer"
echo "is currently NOT supported and not guaranteed to work."
echo
echo "You should read the contents of the shell script at least once before"
echo "running it to know what it does. I cannot help with this script because"
echo "I don't have a clue about the inners of AppImage and its build tools."
echo
echo "Do you have that knowledge and know how to properly pack GTK4 + Libadwaita"
echo "apps in a way that actually works with older versions of libc6 without"
echo "having to use weird tricks? Please help me! Your inputs are appreciated"
echo "Send patches or comments to https://github.com/danirod/cartero"
echo
echo "Last chance. Press Ctrl-C to quit the script, or Enter to start."
read -r
fi

meson setup build --prefix="/" $MESON_FLAGS
ninja -C build
DESTDIR=$PWD/build/appimagetool/AppDir/usr ninja -C build install
Expand Down
6 changes: 3 additions & 3 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Please, keep this file sorted alphabetically.
ca
cs
eo
es
fr
pt_BR
ro
ru
ta
fr
cs
pt_BR

0 comments on commit e1b328b

Please sign in to comment.