ci(travis): add style stage and move dependency

Add a stage that do a style check and move shellcheck dependency to the stage where is used
This commit is contained in:
Giulio Coa 2022-08-05 08:43:45 +02:00
parent b17d309860
commit 3a2466df31

View file

@ -3,15 +3,13 @@ language: shell
addons: addons:
hosts: hosts:
- pivpn.test - pivpn.test
apt:
packages:
- shellcheck
services: services:
- docker - docker
stages: stages:
- lint - lint
- style
- test - test
branches: branches:
@ -24,11 +22,27 @@ jobs:
- stage: lint - stage: lint
name: "Shellcheck lint" name: "Shellcheck lint"
dist: focal dist: focal
addons:
apt:
packages:
- shellcheck
virt: vm virt: vm
arch: amd64 arch: amd64
script: script:
- shellcheck auto_install/install.sh - shellcheck -x auto_install/install.sh
- find scripts/ -type f | xargs shellcheck - find scripts/ -type f | xargs shellcheck -x
- stage: style
name: "Shell Style Guide"
dist: xenial
addons:
snaps:
- shfmt
virt: vm
arch: amd64
script:
- shfmt -d -i 2 -ci -sr auto_install/install.sh
- find scripts/ -type f | xargs shfmt -d -i 2 -ci -sr
- stage: test - stage: test
name: "OpenVPN Xenial & Commands" name: "OpenVPN Xenial & Commands"