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

Add tests to CI #791

Merged
merged 4 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 50 additions & 64 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ env:
CARGO_TERM_COLOR: always

jobs:
linux-cli:
linux-default:
strategy:
matrix:
toolchain: [ stable ]
toolchain: [ stable, 1.60.0 ]
type: [ release ]
runs-on: ubuntu-22.04
steps:
Expand All @@ -27,19 +27,26 @@ jobs:
with:
path: |
target
key: linux-cli-${{github.ref}}-${{github.sha}}
key: linux-default-${{github.ref}}-${{github.sha}}
restore-keys: |
linux-cli-${{github.ref}}-${{github.sha}}
linux-default-${{github.ref}}-${{github.sha}}

- name: Install basic libraries
run: sudo apt-get update; sudo apt install libgtk-4-dev libheif-dev -y

- name: Build CLI Release
run: cargo build --release --bin czkawka_cli --features heif
- name: Build Release
run: cargo build --release
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"
if: ${{ (matrix.type == 'release') && (matrix.toolchain == '1.60.0') }}

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

- name: Store Linux CLI
uses: actions/upload-artifact@v2
Expand All @@ -48,6 +55,13 @@ jobs:
path: target/release/czkawka_cli
if: ${{ matrix.type == 'release' }}

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

# Duplicate finder checks included and excluded directories
# Others are just check delete files number
- name: Linux Regression Test
Expand Down Expand Up @@ -118,12 +132,11 @@ jobs:
python3 misc/check_results.py TestSuite 15 8
target/release/czkawka_cli temp -d "$(pwd)/TestSuite" -D
python3 misc/check_results.py TestSuite 14 8
if: ${{ matrix.type == 'release' }}

linux-gui:
linux-appimage-gui:
strategy:
matrix:
toolchain: [ stable, 1.60.0 ]
toolchain: [ stable ]
type: [ release ]
runs-on: ubuntu-22.04
steps:
Expand All @@ -138,38 +151,36 @@ jobs:
with:
path: |
target
key: linux-gui-${{github.ref}}-${{github.sha}}
key: linux-appimage-gui-${{github.ref}}-${{github.sha}}
restore-keys: |
linux-gui-${{github.ref}}-${{github.sha}}

- name: Install Gtk, Mingw, unzip, zip and wget
run: sudo apt-get update; sudo apt install libgtk-4-dev fuse libfuse2
if: ${{ matrix.toolchain == '1.60.0' }}
linux-appimage-gui-${{github.ref}}-${{github.sha}}

- name: Install Gtk, Mingw, unzip, zip and wget and libheif
run: sudo apt-get update; sudo apt install libgtk-4-dev fuse libfuse2 libheif-dev -y
if: ${{ matrix.toolchain == 'stable' }}
- name: Install Dependencies
run: sudo apt-get update; sudo apt install libgtk-4-dev libheif-dev librsvg2-dev wget fuse libfuse2 -y

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

- name: Build GUI Release
run: cargo build --release --bin czkawka_gui --features heif
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"
if: ${{ (matrix.type == 'release') && (matrix.toolchain == 'stable') }}
- 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/czkawka_gui AppDir/usr/bin
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin gtk --output appimage --icon-file data/icons/com.github.qarmin.czkawka.svg --desktop-file data/com.github.qarmin.czkawka.desktop

- name: Store Linux GUI
- name: Store Linux Appimage GUI
uses: actions/upload-artifact@v2
with:
name: czkawka_gui-${{ runner.os }}-${{ matrix.toolchain }}
path: target/release/czkawka_gui
if: ${{ matrix.type == 'release' }}
name: czkawka_gui-appimage-${{ runner.os }}-${{ matrix.toolchain }}
path: Czkawka*.AppImage

- name: Minimal AppImage
run: |
Expand All @@ -188,12 +199,11 @@ jobs:
name: czkawka_gui-${{ matrix.toolchain }}_minimal_AppImage
path: out/*.AppImage


linux-appimage-gui:
linux-tests:
strategy:
matrix:
toolchain: [ stable ]
type: [ release ]
type: [ debug ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
Expand All @@ -203,35 +213,11 @@ jobs:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v2
with:
path: |
target
key: linux-appimage-gui-${{github.ref}}-${{github.sha}}
restore-keys: |
linux-appimage-gui-${{github.ref}}-${{github.sha}}
- name: Install Dependencies
run: sudo apt-get update; sudo apt install libgtk-4-dev libheif-dev librsvg2-dev wget fuse libfuse2 -y xvfb

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

- name: Build GUI Release
run: cargo build --release --bin czkawka_gui
- name: Test
run: xvfb-run cargo test
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"

- name: Download appimage dependiences
run: |
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
cp target/release/czkawka_gui AppDir/usr/bin
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin gtk --output appimage --icon-file data/icons/com.github.qarmin.czkawka.svg --desktop-file data/com.github.qarmin.czkawka.desktop

- name: Store Linux Appimage GUI
uses: actions/upload-artifact@v2
with:
name: czkawka_gui-appimage-${{ runner.os }}-${{ matrix.toolchain }}
path: Czkawka*.AppImage
RUSTFLAGS: "-C debuginfo=0"
45 changes: 12 additions & 33 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,9 @@ jobs:
with:
path: |
target
key: mac-cli-${{github.ref}}-${{github.sha}}
key: mac-${{github.ref}}-${{github.sha}}
restore-keys: |
mac-cli-${{github.ref}}-${{github.sha}}

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

- name: Store MacOS CLI
uses: actions/upload-artifact@v2
with:
name: czkawka_cli-${{ runner.os }}-${{ matrix.toolchain }}
path: target/release/czkawka_cli
if: ${{ matrix.type == 'release' }}

macos-gui:
strategy:
matrix:
toolchain: [ stable ]
type: [ release ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

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

- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Expand All @@ -68,16 +40,23 @@ jobs:
- name: Install GTK4
run: brew install rust gtk4 libheif

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

- name: Store MacOS CLI
uses: actions/upload-artifact@v2
with:
name: czkawka_cli-${{ runner.os }}-${{ matrix.toolchain }}
path: target/release/czkawka_cli
if: ${{ matrix.type == 'release' }}

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