Skip to content
Open
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
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
time: "08:00"
timezone: "UTC"
19 changes: 19 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- someuser
categories:
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: Exciting New Features 🎉
labels:
- enhancement
- title: Dependencies
labels:
- dependencies
- title: Other Changes
labels:
- "*"
57 changes: 57 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: build

on:
push:
branches:
- master
pull_request:
env:
resourceRunID: ${{ github.run_id }}-${{ github.run_number }}

jobs:
Build:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ Ubuntu-24.04 ]
prepare: [ sudo apt-get update && sudo apt-get install -y exiftool imagemagick xdg-utils libimage-exiftool-perl zsh jq xorg ]
include:
- os: macos-15
prepare: export PATH=/opt/homebrew/bin:$PATH && brew install exiftool imagemagick && brew outdated jq || brew install jq

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: false
- name: Prepare ${{ matrix.os }} environment
run: |
${{ matrix.prepare }}

- name: Install git-diff-image
if: ${{ always() }}
run: |
./install.sh

- name: Compare screenshots
if: ${{ always() }}
run: |
git status
cp ./test/false_StartTest_smokeTestStart.png ./screenshotsToCompare/StartTest_smokeTestStart.png
./test/testDiffImage.sh

- name: Archive screenshots diffs
if: ${{ always() }}
uses: actions/upload-artifact@v5
with:
name: diffs-${{ matrix.os }}
path: |
screenshotDiffs
- name: Show git status
if: ${{ always() }}
run: |
git reset --hard
git add screenshotDiffs
git status
Binary file added screenshotsToCompare/StartTest_smokeTestStart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/false_StartTest_smokeTestStart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions test/lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

## This file is intended to be sourced by other scripts

function err() {
echo >&2 "$@"
}

function curl_gh() {
if [[ -n "$CLASSIC_TOKEN" ]]; then
curl \
--silent \
--header "Authorization: token $CLASSIC_TOKEN" \
"$@"
else
err "WARNING: No CLASSIC_TOKEN found. Skipping API call"
fi
}
38 changes: 38 additions & 0 deletions test/testDiffImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/zsh
set -eo pipefail # automatic. fails on any error

OS="`uname`"
case $OS in
'Linux')
echo "Fix display on Linux"
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
;;
'FreeBSD')
;;
'WindowsNT')
;;
'Darwin')
#brew install jq | echo "Nothing to do with brew"
;;
'SunOS')
;;
'AIX') ;;
*) ;;
esac

diffFiles=./screenshotDiffs
mkdir $diffFiles
GIT_DIFF_IMAGE_OUTPUT_DIR=$diffFiles git diff-image

pwd
source $(dirname $0)/lib.sh

echo "GITHUB_REF_NAME=$GITHUB_REF_NAME"
echo $(echo "$GITHUB_REF_NAME" | sed "s/\// /")
PR=$(echo "$GITHUB_REF_NAME" | sed "s/\// /" | awk '{print $1}')
echo "PR=$PR GITHUB_REF_NAME=$GITHUB_REF_NAME"

# set error when diffs are there
echo ""
[ "$(ls -A $diffFiles)" ] && echo "==> Diff files exists as expected" && exit 0 || echo "==> Diff files doesn't exist" && exit 1