os: linux
dist: bionic

language: shell

cache:
  apt: true

git:
  quiet: true

before_script:
  - sudo apt-get install tree -y
  - sudo apt-get -qq autoremove --purge
addons:
  apt:
    update: true

script:
  - sudo apt-get install jpegoptim -y
  - sudo -E time bash scripts/install-webp.sh > /dev/null 2>&1
  - sudo -E time bash scripts/install-optipng.sh > /dev/null 2>&1
  - sudo wget -qO /usr/local/bin/avif https://github.com/Kagami/go-avif/releases/download/v0.1.0/avif-linux-x64
  - sudo chmod +x /usr/local/bin/avif
  - sudo cp optimize.sh /usr/local/bin/img-optimize
  - sudo chmod 755 /usr/local/bin/img-optimize
  - ls -alh images/
  - /usr/local/bin/img-optimize --all -q
  - ls -alh images/
  - /usr/local/bin/img-optimize --jpg -q
  - /usr/local/bin/img-optimize --png -q
  - rm images/*.webp
  - /usr/local/bin/img-optimize --webp
  - tree -L 2 .
  - rm images/*.webp
  - /usr/local/bin/img-optimize --webp --quiet