denny/ShinyCMS

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2
jobs:
    build:
        docker:
            - image: perl:5
            - image: circleci/mysql:5.7
              environment:
                MYSQL_ALLOW_EMPTY_PASSWORD: yes
                MYSQL_ROOT_PASSWORD: ''
                MYSQL_DATABASE: shinycms_test
                MYSQL_USER: shinyuser
                MYSQL_PASSWORD: shinypass
                MYSQL_HOSTNAME: 127.0.0.1

        environment:
            TAR_OPTIONS: --no-same-owner
            SHINYCMS_TEST: 1
            RECAPTCHA_OFF: 1
            TEST_CRITIC: 1
            TEST_POD: 1

        steps:
            - checkout

            - restore_cache:
                name: Restore cache of required packages and modules
                key: MakefilePL-{{ checksum "Makefile.PL" }}

            - run:
                name: Install distro packages
                command: apt update && apt install -y libdbd-mysql-perl

            - run:
                name: Install dependencies from CPAN
                command: |
                    cpanm --quiet --notest --no-man-pages Module::Install::Catalyst DBD::mysql
                    cpanm --quiet --notest --no-man-pages DBIx::Class::EncodedColumn@0.00016
                    cpanm --quiet --notest --no-man-pages --installdeps .

            - save_cache:
                name: Saving cache after installing required packages and modules
                key: MakefilePL-{{ checksum "Makefile.PL" }}
                paths:
                    - /usr/local/lib/perl5
                    - ~/perl5

            - run:
                name: Reinstall Devel::Cover until I fix the disappearing 'cover' problem
                command: |
                    cpanm --reinstall --quiet --notest --no-man-pages Devel::Cover

            - run:
                name: Set up database
                command: bash bin/database/build-with-demo-data

            - run:
                name: Run tests with coverage analysis
                command: bash bin/test/run-tests-with-coverage

            - run:
                name: Generate coverage data for codecov
                command: cover -report codecov