From d05065f3aa1ccdf991fce5395de7e3e58f36b61c Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Tue, 20 Feb 2024 09:35:34 +0300 Subject: [PATCH] ci: introduce --- .config/dotfiles/gitignore | 1 + .config/dotfiles/woodpecker.yml | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .config/dotfiles/woodpecker.yml diff --git a/.config/dotfiles/gitignore b/.config/dotfiles/gitignore index 5431858..8d1df39 100644 --- a/.config/dotfiles/gitignore +++ b/.config/dotfiles/gitignore @@ -6,6 +6,7 @@ !/.config/dotfiles/gitignore !/.config/dotfiles/install.sh !/.config/dotfiles/scripts/.keep +!/.config/dotfiles/woodpecker.yml !/.config/htop/htoprc.example !/.config/mc/ini.example !/.config/zsh/_.zsh diff --git a/.config/dotfiles/woodpecker.yml b/.config/dotfiles/woodpecker.yml new file mode 100644 index 0000000..4b406a9 --- /dev/null +++ b/.config/dotfiles/woodpecker.yml @@ -0,0 +1,34 @@ +steps: + - name: check + image: debian:bookworm-slim + environment: + DEBCONF_NONINTERACTIVE_SEEN: "true" + DEBIAN_FRONTEND: noninteractive + DEBIAN_PRIORITY: critical + TERM: linux + MALLOC_ARENA_MAX: "4" + commands: + - | + : # install required packages + apt-get -y update + apt-get -y install file findutils git shellcheck zsh + apt-get -y clean + - | + : # verify that repo doesn't contain "garbage" + find_fast() { + find "$@" -printf . -quit | grep -Fq . + } + if find_fast ./ -type f -name '*.zwc' ; then + echo 'found *.zwc' >&2 + find ./ -type f -name '*.zwc' + exit 1 + fi + - | + : # try zsh compile + git ls-files | sort -uV | xargs -r file -N -i | grep text/x-shellscript | cut -d: -f1 \ + | xargs -r -n1 zsh -efc 'zcompile -UR "$@"' -- + find ./ -type f -name '*.zwc' -delete + - | + : # try shellcheck (except for *.zsh) + git ls-files | grep -Fv '.zsh' | sort -uV | xargs -r file -N -i | grep text/x-shellscript | cut -d: -f1 \ + | xargs -r -n1 shellcheck