# The standard configuration file to run our Vagrant tests in QI # # See https://github.com/avtar/qi-development-environments --- # Cache directories such as 'node_modules' in between stages. cache: key: "$CI_BUILD_REF_NAME" untracked: true paths: - node_modules/ # Run the following stages sequentially. stages: - vagrant_up - vagrant_tests - vagrant_destroy # Move the '.vagrant' directory to a location so that it won't be removed by the CI runner when it # cleans the workspace. before_script: - "mkdir -p ../.vagrant-$CI_BUILD_REF_NAME" - rm -fr .vagrant - "ln -s ../.vagrant-$CI_BUILD_REF_NAME .vagrant" # "when: always" ensures the 'vagrant up' (and later 'vagrant destroy -f') command is run always, # so failures in other stages won't interfere with the execution of these critical stages. vagrant_up: stage: vagrant_up script: - export DISPLAY=:0 - vagrant box update - vagrant up when: always vagrant_tests: stage: vagrant_tests script: - export DISPLAY=:0 - vagrant ci test coverage: '/.+ Coverage summary .+/' artifacts: paths: - reports/ vagrant_destroy: stage: vagrant_destroy script: - vagrant destroy -f - "rm -fr ../.vagrant-$CI_BUILD_REF_NAME" when: always