chore: add github workflow (#6)

This commit is contained in:
Stéphane Lesimple 2019-11-18 12:44:16 -08:00 committed by GitHub
parent e5f775cfc3
commit 317becb513
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 1 deletions

27
.github/workflows/check.yml vendored Normal file
View file

@ -0,0 +1,27 @@
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install prerequisites
run: sudo apt-get install -y perl libperl-critic-perl perltidy
- name: perl check
run: perl -c btrfs-list
- name: perlcritic
run: perlcritic btrfs-list
- name: perltidy
run: |
perltidy --paren-tightness=2 --square-bracket-tightness=2 --brace-tightness=2 --maximum-line-length=180 btrfs-list
if cmp btrfs-list btrfs-list.tdy; then
echo "OK: perltidy didn't find any change to make"
else
echo "KO: perltidy found changes to make:"
diff -u btrfs-list btrfs-list.tdy
exit 1
fi

View file

@ -215,7 +215,7 @@ if (defined $opt_snap_max_used) {
$opt_snap_max_used = human2raw($opt_snap_max_used);
}
if ($opt_color eq 'never' || ($opt_color eq 'auto' && !-t 1)) {
if ($opt_color eq 'never' || ($opt_color eq 'auto' && !-t 1)) { ## no critic
$ENV{'ANSI_COLORS_DISABLED'} = 1;
}