diff options
author | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2022-04-28 17:28:21 +0200 |
---|---|---|
committer | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2022-04-28 18:06:58 +0200 |
commit | fecce38c453ee7721b225e9b63f7b5bcb986ef72 (patch) | |
tree | 76f23521f3ce9200e7aa0ffb72d2d580715f70f2 | |
parent | b7e5eeb35d6a39bd4a69d6d455d4b4afeb6d2029 (diff) | |
download | elementary-xfce-add-github-action.tar.gz |
Add GitHub action to test for dangling symlinksadd-github-action
Create a 'make test' target that skips the png optimization because that
would be a waste of time in CI. Also the pngtheme.sh script now fails if
dangling symlinks are detected.
-rw-r--r-- | .github/workflows/symlinks.yml | 18 | ||||
-rwxr-xr-x | Makefile.in | 4 | ||||
-rwxr-xr-x | svgtopng/pngtheme.sh | 5 |
3 files changed, 25 insertions, 2 deletions
diff --git a/.github/workflows/symlinks.yml b/.github/workflows/symlinks.yml new file mode 100644 index 00000000..c58fac5f --- /dev/null +++ b/.github/workflows/symlinks.yml @@ -0,0 +1,18 @@ +name: "Check symlinks" + +on: [pull_request, push] + +jobs: + check: + name: Check for dangling symlinks + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Check symlinks + shell: bash + run: | + sudo apt install -y libgtk-3-dev --no-install-recommends + ./configure + make test diff --git a/Makefile.in b/Makefile.in index 3f5f0456..0565aa11 100755 --- a/Makefile.in +++ b/Makefile.in @@ -30,12 +30,14 @@ icon-caches: gtk-update-icon-cache -f $(DESTDIR)/$(PREFIX)/share/icons/elementary-xfce-darker gtk-update-icon-cache -f $(DESTDIR)/$(PREFIX)/share/icons/elementary-xfce-darkest -build: builddir $(SUBDIRS) +test: builddir $(SUBDIRS) chmod +x ./svgtopng/pngtheme.sh @./svgtopng/pngtheme.sh build/elementary-xfce @./svgtopng/pngtheme.sh build/elementary-xfce-dark @./svgtopng/pngtheme.sh build/elementary-xfce-darker @./svgtopng/pngtheme.sh build/elementary-xfce-darkest + +build: test @echo == Optimizing all icon pngs @find build -type f -iname '*.png' | xargs optipng -strip all -silent diff --git a/svgtopng/pngtheme.sh b/svgtopng/pngtheme.sh index 6f536855..28474677 100755 --- a/svgtopng/pngtheme.sh +++ b/svgtopng/pngtheme.sh @@ -28,4 +28,7 @@ find "$icondir" -iname '*.svg' -not \( -wholename "*/scalable/*" -o -wholename " #ignore the output if the theme depends on another one (e.g. elementary-xfce-dark needs to be converted before elementary-xfce) echo " * Checking dangling symlinks" -find -L "$icondir" -type l -exec /bin/ls -go {} \; +if find -L "elementary-xfce" -type l -exec /bin/ls -go {} \; | grep .; then + echo "Found some dangling symlinks, please go fix those."; + exit 1; +fi |