Skip to content

Commit

Permalink
F! AppVeyor polish
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed May 3, 2018
1 parent 6cf9023 commit b790f98
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ branches:
skip_tags: true ## do not build on tags

environment:
global:
## configuration (".appveyor_env.{BAT,PS1}", if present, may/might override these values [by design])
DEVEL_COVER_OPTIONS: "" ## "" => auto-set, value determined by DIST_TOOLING; " " is a neutral setting which will block auto-set
DIST_EXTRA_DEPS: "" ## additional required/requested dependencies for build and/or testing
DIST_SUPPRESS_DEPS: "" ## [ "" == false, <non-empty> == true ]; "true" can be useful for CORE modules, suppressing testing for and installing of dependencies, unless otherwise required (by COVERAGE or DIST_EXTRA_DEPS)
DIST_TOOLING: "" ## [ "build", "make" ]; "" => auto-set based on existence of "Build.PL" and/or "Makefile.PL"
TEST_METHOD: "" ## "" => auto-set to generally either `prove -b` for build/make distributions or `prove -l` otherwise (eg, dzil distributions)
## ---
matrix:
- Perl_VERSION: "latest"
COVERAGE: "Codecov Coveralls" ## note: case sensitive!
Expand All @@ -40,19 +32,31 @@ environment:
# - C:\strawberry -> .appveyor.yml

install:
- echo [%TIME%] { install }
## debug?
- if NOT DEFINED CI_HELPER_DEBUG ( set "CI_HELPER_DEBUG=" ) &::## [ "" == false, <non-empty> == true ]; "true" enables detailed output for the helper scripts
## configuration (".appveyor_env.{BAT,PS1}", if present, can override these values [by design])
- if NOT DEFINED CI_HELPER_BRANCH ( set "CI_HELPER_DEBUG=" ) &::## "" => auto-set, valid alternates are [ "stable" {the default}, "canary", BRANCH, or TAG ]
- if NOT DEFINED DEVEL_COVER_OPTIONS ( set "DEVEL_COVER_OPTIONS=" ) &::## "" => auto-set, value determined by DIST_TOOLING; " " is a neutral setting which will block auto-set
- if NOT DEFINED DIST_EXTRA_DEPS ( set "DIST_EXTRA_DEPS=" ) &::## additional required/requested dependencies for build and/or testing
- if NOT DEFINED DIST_SUPPRESS_DEPS ( set "DIST_SUPPRESS_DEPS=" ) &::## [ "" == false, <non-empty> == true ]; "true" can be useful for CORE modules, suppressing testing for and installing of dependencies, unless otherwise required {by COVERAGE or DIST_EXTRA_DEPS}
- if NOT DEFINED DIST_TOOLING ( set "DIST_TOOLING=" ) &::## [ "build", "make" ]; "" => auto-set based on existence of "Build.PL" and/or "Makefile.PL"
- if NOT DEFINED TEST_METHOD ( set "TEST_METHOD=" ) &::## "" => auto-set to generally either `prove -b` for build/make distributions or `prove -l` otherwise {eg, dzil distributions}
## ---
# perform any special preparation (optional; distribution specific)
# * note: optional external file(s), global scope => allows ".appveyor.yml" to remain more stable and similar [or the same] between different distributions [eg, for automated distribution of ".appveyor.yml" changes]
- if EXIST ".appveyor_env.BAT" ( call .appveyor_env.BAT )
- ps: if ( test-path ".appveyor_env.PS1" ) { . ".\.appveyor_env.PS1" }
# create a working area
- ps: if ( ! $env:AVCI_TEMP_DIR ) { $env:AVCI_TEMP_DIR = "${env:TEMP}\${env:APPVEYOR_JOB_ID}" ; mkdir -force $env:AVCI_TEMP_DIR | out-null }
- ps: if ( ! $env:CI_TEMP_DIR ) { $env:CI_TEMP_DIR = "${env:TEMP}\${env:APPVEYOR_JOB_ID}" ; mkdir -force $env:CI_TEMP_DIR | out-null }
# find / download helpers
# * use "vendored" copy if present
- if NOT DEFINED AVCI_HELPERS if EXIST ".appveyor_bin" ( set "AVCI_HELPERS=.\.appveyor_bin" )
- if NOT DEFINED CI_HELPERS if EXIST ".appveyor_bin" ( set "CI_HELPERS=.\.appveyor_bin" )
# * download helpers from repo if needed
- ps: if ( ! $env:AVCI_HELPERS ) { $repo_path = $( mkdir "${env:AVCI_TEMP_DIR}\helpers" ).Fullname ; & 'CMD' @( '/c', "git clone https://github.com/rivy/AppVeyorCI.helpers-perl.git `"$repo_path`" 2>&1" ) ; $env:AVCI_HELPERS = "${repo_path}\.appveyor_bin" }
- if NOT DEFINED CI_HELPER_BRANCH ( set "CI_HELPER_BRANCH=stable" )
- ps: if ( ! $env:CI_HELPERS ) { $repo_path = $( mkdir "${env:CI_TEMP_DIR}\helpers" ).Fullname ; & 'CMD' @( '/c', "git clone https://github.com/rivy/AppVeyorCI.helpers-perl.git `"$repo_path`" -b $env:CI_HELPER_BRANCH 2>&1" ) ; $env:CI_HELPERS = "${repo_path}\.appveyor_bin" }
# resolve requested coverage with needed configuration
- ps: . "${env:AVCI_HELPERS}\install.eval-coverage.ps1"
- ps: . "${env:CI_HELPERS}\install.eval-coverage.ps1"
##
# move "C:\mingw" to avoid cross library linking (a problem with older perl versions, breaking dll compilation with "/mingw/lib/dllcrt2.o:(.text+0xd1): undefined reference to `__dyn_tls_init_callback'")
# * only truly needed for modules containing XS compilation, but ok for all modules
Expand All @@ -64,22 +68,23 @@ install:
# * ref: <https://github.com/appveyor/ci/issues/1606>[`@`](https://archive.is/RVpnF)
- if DEFINED APPVEYOR_REPO_BRANCH if /I "%APPVEYOR_REPO_SCM%"=="git" ( git checkout "%APPVEYOR_REPO_BRANCH%" & git reset --hard "%APPVEYOR_REPO_COMMIT%" )
# install perl (strawberry variant) + version verification
- call "%AVCI_HELPERS%\install.install-perl.BAT"
- call "%CI_HELPERS%\install.install-perl.BAT"
- perl -V
# determine build tooling
- if NOT DEFINED DIST_TOOLING if EXIST "Build.PL" ( set "DIST_TOOLING=build" )
- if NOT DEFINED DIST_TOOLING if EXIST "Makefile.PL" ( set "DIST_TOOLING=make" )
# setup DEVEL_COVER_OPTIONS, if needed
- ps: if (! $env:DEVEL_COVER_OPTIONS) { . "${env:AVCI_HELPERS}\install.setup-cover-options.ps1" }
- ps: if (! $env:DEVEL_COVER_OPTIONS) { . "${env:CI_HELPERS}\install.setup-cover-options.ps1" }
# setup testing method/options, based on distrbution tooling and existence of "blib"
- if NOT DEFINED TEST_METHOD if NOT DEFINED DIST_TOOLING if NOT EXIST "blib" ( set "TEST_METHOD=prove -l" )
- if NOT DEFINED TEST_METHOD ( set "TEST_METHOD=prove -b" )
# distribution prep prior to the build/make process (ie, build dependencies and OS_unsupported check)
- call "%AVCI_HELPERS%\install.setup-dist.BAT"
- call "%CI_HELPERS%\install.setup-dist.BAT"
# coverage prep
- ps: . "${env:AVCI_HELPERS}\install.setup-coverage.ps1"
- ps: . "${env:CI_HELPERS}\install.setup-coverage.ps1"

before_build:
- echo [%TIME%] { before_build }
# ensure CWD is project main directory
- cd "%APPVEYOR_BUILD_FOLDER%"
# setup environment options
Expand All @@ -92,18 +97,19 @@ before_build:
# * for COVERAGE builds, preload JSON:PP to avoid JSON::PP::Boolean redefine warning (see <https://github.com/rurban/Cpanel-JSON-XS/issues/65#issuecomment-219352754>)
- if DEFINED COVERAGE (set HARNESS_PERL_SWITCHES=-MJSON::PP %HARNESS_PERL_SWITCHES%)
#
- call "%AVCI_HELPERS%\before_build.dist.BAT"
- call "%CI_HELPERS%\before_build.dist.BAT"
# show final build-related environment variables
- call "%AVCI_HELPERS%\log-env.BAT"
- call "%CI_HELPERS%\log-env.BAT"


build_script:
- call "%AVCI_HELPERS%\build.dist.BAT"
- echo [%TIME%] { build } & call "%CI_HELPERS%\build.dist.BAT"

test_script:
- echo [ `%TEST_METHOD%` ] & call %TEST_METHOD%
- echo [%TIME%] { test } `%TEST_METHOD%` & call %TEST_METHOD%

after_test:
- echo [%TIME%] { after_test }
# reporting
# * report any code coverage information
- ps: |
Expand Down

0 comments on commit b790f98

Please sign in to comment.