From 204bc6b5fa0d348bea9dae7976b8df4cf75d057b Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sat, 26 Jan 2019 19:53:49 +0200 Subject: [PATCH] optimize travis.yml --- .travis.yml | 67 +++++++++++++++++++++++------------------- tests/lib/MyTidyAll.pm | 27 +++++++++++++++++ tests/style/tidyall.t | 7 +++-- 3 files changed, 67 insertions(+), 34 deletions(-) create mode 100644 tests/lib/MyTidyAll.pm diff --git a/.travis.yml b/.travis.yml index c5b84c01..3c3ed906 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,38 @@ -dist: trusty addons: - apt: - packages: - - cpanminus - - libperl-dev - - make - - perl - - python-glade2 - - python-gnome2 - - python-gnome2-dev - - python-gtk2 - - python-setuptools - - python-tk - - python3 - - python3-pip - - python3-setuptools - - python3-tk - homebrew: - update: true - brewfile: true + apt: + packages: + - cpanminus + - libperl-dev + - make + - perl + - python-glade2 + - python-gnome2 + - python-gnome2-dev + - python-gtk2 + - python-setuptools + - python-tk + - python3 + - python3-pip + - python3-setuptools + - python3-tk + homebrew: + update: true + brewfile: true +cache: + directories: + - $HOME/perl_modules + - $HOME/tidyall_d +deploy: + provider: releases + api_key: + secure: SrKnXigL/oUHNbqpbGx0DB1o+LAEkfPA2QTBllXxg4V+1vGAHBT9FRecp8Do+no/zSPRttH+sPDEPBXMMAV0BWVKKw5Mxas/S5ulVkNdfxpTq1bKjI3EjZbVsS1zZlHe0P77TDFDAj8zyeiYecBM08suhd9OvScieiPlpFPE1UYp9vvNKaBgc66IRNnIDRBdktW4YLsgvkrpXnxGPy8gGwylsTeOzNs5/r5dzHswGdksJl46kqCIbV+s4/Xcx+BEnfibWzEFZmLQoGKhoukbSis3YXGIlERcgiVU6v7S2D4wbwUXSAKOj/Io7z/88Co2P3Qbm538kf/pjeR9+DaM1HsHQQcL0detCjjLog+ekKr2fM00QI1yRmqOiZtuXxTMpneYX73EBmPt4la4rjKmnlhS+NTxrynHcPZD8QopCPvoZ3sUD6dQCrbi8kcGxe13srfdJ3KjuWZXdedLIOgNELbj5o6GNivsanWna59yoJzChC5/H5Jjllncvzbp56TZfEkM1NJkE84jjSS8Sn2KLXjD0woHIsuUSkRNExrCt/6QmIub/QxZPUhwQ2J0xCv1IJPdd0XvO3gCqasG3UA2Q0OlP172x92ocOV/wm1/4wfoG6v/mn+bX5ZwvrsMmm+r3FKKlM8L3T33yFjMzgG/YMoRN8w7pXUIkdtZK8EEDVg= + # file: dist/PySolFC.app + file: PySolFC.app.tar.xz + on: + repo: shlomif/PySolFC + tags: true + skip_cleanup: true +dist: trusty before_install: - if test "$TRAVIS_OS_NAME" = "osx" ; then export CPPFLAGS="$CPPFLAGS -I$(brew --prefix openssl)/include" PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig:$PKG_CONFIG_PATH" LDFLAGS="$LDFLAGS -L$(brew --prefix openssl)/lib" ;fi install: @@ -43,17 +57,8 @@ matrix: - LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl/lib" - CPPFLAGS="$CPPFLAGS -I/usr/local/opt/openssl/include" script: - - "sh -x scripts/travis-ci-build" + - export TIDYALL_DATA_DIR="$HOME/tidyall_d" + - bash -x scripts/travis-ci-build - if test "$TRAVIS_OS_NAME" = "osx" ; then PYTHONPATH="`pwd`" python3 setup_osx.py py2app ; fi - if test "$TRAVIS_OS_NAME" = "osx" ; then find . -iname '*.app' ; fi - if test "$TRAVIS_OS_NAME" = "osx" ; then (cd dist; tar -cvf ../PySolFC.app.tar PySolFC.app/ ; ); xz PySolFC.app.tar ; fi -deploy: - provider: releases - api_key: - secure: SrKnXigL/oUHNbqpbGx0DB1o+LAEkfPA2QTBllXxg4V+1vGAHBT9FRecp8Do+no/zSPRttH+sPDEPBXMMAV0BWVKKw5Mxas/S5ulVkNdfxpTq1bKjI3EjZbVsS1zZlHe0P77TDFDAj8zyeiYecBM08suhd9OvScieiPlpFPE1UYp9vvNKaBgc66IRNnIDRBdktW4YLsgvkrpXnxGPy8gGwylsTeOzNs5/r5dzHswGdksJl46kqCIbV+s4/Xcx+BEnfibWzEFZmLQoGKhoukbSis3YXGIlERcgiVU6v7S2D4wbwUXSAKOj/Io7z/88Co2P3Qbm538kf/pjeR9+DaM1HsHQQcL0detCjjLog+ekKr2fM00QI1yRmqOiZtuXxTMpneYX73EBmPt4la4rjKmnlhS+NTxrynHcPZD8QopCPvoZ3sUD6dQCrbi8kcGxe13srfdJ3KjuWZXdedLIOgNELbj5o6GNivsanWna59yoJzChC5/H5Jjllncvzbp56TZfEkM1NJkE84jjSS8Sn2KLXjD0woHIsuUSkRNExrCt/6QmIub/QxZPUhwQ2J0xCv1IJPdd0XvO3gCqasG3UA2Q0OlP172x92ocOV/wm1/4wfoG6v/mn+bX5ZwvrsMmm+r3FKKlM8L3T33yFjMzgG/YMoRN8w7pXUIkdtZK8EEDVg= - # file: dist/PySolFC.app - file: PySolFC.app.tar.xz - on: - repo: shlomif/PySolFC - tags: true - skip_cleanup: true diff --git a/tests/lib/MyTidyAll.pm b/tests/lib/MyTidyAll.pm new file mode 100644 index 00000000..7555dee8 --- /dev/null +++ b/tests/lib/MyTidyAll.pm @@ -0,0 +1,27 @@ +package MyCacheModel; + +use Moo; + +extends('Code::TidyAll::CacheModel'); + +my $DUMMY_LAST_MOD = 0; + +sub _build_cache_value +{ + my ($self) = @_; + + return $self->_sig( + [ $self->base_sig, $DUMMY_LAST_MOD, $self->file_contents ] ); +} + +package main; + +use Test::Code::TidyAll qw/ tidyall_ok /; + +my $KEY = 'TIDYALL_DATA_DIR'; +tidyall_ok( + cache_model_class => 'MyCacheModel', + ( exists( $ENV{$KEY} ) ? ( data_dir => $ENV{$KEY} ) : () ) +); + +1; diff --git a/tests/style/tidyall.t b/tests/style/tidyall.t index 99421ab2..c6114924 100644 --- a/tests/style/tidyall.t +++ b/tests/style/tidyall.t @@ -3,12 +3,13 @@ use strict; use warnings; -if ( $ENV{FCS_TEST_SKIP_PERLTIDY} ) +if ( $ENV{TEST_SKIP_TIDYALL} ) { require Test::More; Test::More::plan( 'skip_all' => "Skipping perltidy test because FCS_TEST_SKIP_PERLTIDY was set" ); } -require Test::Code::TidyAll; -Test::Code::TidyAll::tidyall_ok( conf_file => ".tidyallrc", ); +use lib './tests/lib'; + +require MyTidyAll;