Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gtk4 port #65

Merged
merged 18 commits into from
Nov 26, 2022
103 changes: 71 additions & 32 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,138 @@
name: 🐧 Linux
on: [ push, pull_request ]
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 2'

env:
CARGO_TERM_COLOR: always

jobs:
linux:
linux-default:
strategy:
matrix:
toolchain: [ stable ]
toolchain: [ stable, 1.63.0 ]
type: [ release ]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
target
key: linux-${{github.ref}}-${{github.sha}}
key: linux-default-${{github.ref}}-${{github.sha}}
restore-keys: |
linux-${{github.ref}}-${{github.sha}}

- name: Install Gtk, Mingw, unzip, zip and wget
run: sudo apt update; sudo apt install libgtk-3-dev -y
linux-default-${{github.ref}}-${{github.sha}}

- name: Build Debug
run: cargo build
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
if: ${{ matrix.type == 'debug'}}
- name: Install basic libraries
run: sudo apt-get update; sudo apt install libgtk-4-dev -y

- name: Build Release
run: cargo build --release
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
if: ${{ matrix.type == 'release'}}
RUSTFLAGS: "-C debuginfo=0"
if: ${{ (matrix.type == 'release') && (matrix.toolchain == 'stable') }}

- name: Store Linux
uses: actions/upload-artifact@v2
- name: Store Linux GUI
uses: actions/upload-artifact@v3
with:
name: szyszka-${{ runner.os }}-${{ matrix.toolchain }}
path: target/release/szyszka
if: ${{ matrix.type == 'release' }}

linux-appimage:
linux-appimage-gui:
strategy:
matrix:
toolchain: [ stable ]
type: [ release ]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
target
key: linux-appimage-${{github.ref}}-${{github.sha}}
key: linux-appimage-gui-${{github.ref}}-${{github.sha}}
restore-keys: |
linux-appimage-${{github.ref}}-${{github.sha}}
linux-appimage-gui-${{github.ref}}-${{github.sha}}

- name: Install Gtk,
run: sudo apt update; sudo apt install libgtk-3-dev librsvg2-dev wget -y
- name: Install Dependencies
run: sudo apt-get update; sudo apt install libgtk-4-dev librsvg2-dev wget fuse libfuse2 -y

- name: Build Release
run: cargo build --release
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
RUSTFLAGS: "-C debuginfo=0"

- name: Download appimage dependiences
run: |
pwd
wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod +x linuxdeploy-plugin-gtk.sh
chmod +x linuxdeploy-x86_64.AppImage
mkdir -p AppDir/usr/bin
pwd
cp target/release/szyszka AppDir/usr/bin
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin gtk --output appimage --icon-file data/icons/com.github.qarmin.szyszka.svg --desktop-file data/com.github.qarmin.szyszka.desktop

- name: Store Linux Appimage
uses: actions/upload-artifact@v2
- name: Store Linux Appimage GUI
uses: actions/upload-artifact@v3
with:
name: szyszka-appimage-${{ runner.os }}-${{ matrix.toolchain }}
path: Szyszka*.AppImage

- name: Minimal AppImage
run: |
pwd
rm -rf szyszka
cp target/release/szyszka .
strip szyszka
wget https://github.com/AppImage/pkg2appimage/releases/download/continuous/pkg2appimage-1807-x86_64.AppImage
chmod +x pkg2appimage-1807-x86_64.AppImage
./pkg2appimage-1807-x86_64.AppImage misc/szyszka-appimage-recipe.yml
mv out/Szyszka*.AppImage out/szyszka-minimal.AppImage

- name: Minimal Appimage Upload
uses: actions/upload-artifact@v3
with:
name: szyszka-${{ matrix.toolchain }}_minimal_AppImage
path: out/*.AppImage

linux-tests:
strategy:
matrix:
toolchain: [ stable ]
type: [ debug ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- name: Install Dependencies
run: sudo apt-get update; sudo apt install libgtk-4-dev librsvg2-dev wget fuse libfuse2 -y xvfb

- name: Test
run: xvfb-run cargo test
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"
44 changes: 21 additions & 23 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: 🍎 MacOS
on: [ push, pull_request ]
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 2'

env:
CARGO_TERM_COLOR: always
Expand All @@ -12,39 +16,33 @@ jobs:
type: [ release ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v3
with:
path: |
target
key: mac-${{github.ref}}-${{github.sha}}
restore-keys: |
mac-${{github.ref}}-${{github.sha}}

- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

- name: Override link[WORKAROUND] # Looks that this is a bug with current homebrew or Github CI
- name: Override link[WORKAROUND] # Looks that this is a bug with current homebrew or GitHub CI
run: rm '/usr/local/bin/2to3'

- name: Install GTK3
run: brew install rust gtk+3

- name: Build Debug
run: cargo build
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
if: ${{ matrix.type == 'debug'}}

- name: Build Release
run: cargo build --release
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
if: ${{ matrix.type == 'release'}}

- name: Store MacOS
uses: actions/upload-artifact@v2
- name: Install GTK4
run: brew install rust gtk4 libheif

- name: Store MacOS GUI
uses: actions/upload-artifact@v3
with:
name: szyszka-${{ runner.os }}-${{ matrix.toolchain }}
path: target/release/szyszka
if: ${{ matrix.type == 'release' }}
if: ${{ matrix.type == 'release' }}
16 changes: 10 additions & 6 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
name: Quality
on: [ push, pull_request ]
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 2'

env:
CARGO_TERM_COLOR: always

jobs:
quality:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
target
Expand All @@ -24,8 +28,8 @@ jobs:
components: rustfmt, clippy
override: true

- name: Install Gtk
run: sudo apt update;sudo apt install -y libgtk-3-dev
- name: Install Gtk 4
run: sudo apt-get update; sudo apt install -y libgtk-4-dev -y

- name: Check the format
run: cargo fmt --all -- --check
Expand Down
Loading