Skip to content

Merge pull request #75 from davorg/dependabot/github_actions/actions/… #74

Merge pull request #75 from davorg/dependabot/github_actions/actions/…

Merge pull request #75 from davorg/dependabot/github_actions/actions/… #74

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
unit_tests:
services:
mariadb:
image: mariadb:latest
ports:
- 13306:3306
env:
MYSQL_USER: succession
MYSQL_PASSWORD: strongpassword
MYSQL_ROOT_PASSWORD: sekrit
MYSQL_DATABASE: succession
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
SUCC_DB_USER: succession
SUCC_DB_HOST: 127.0.0.1
SUCC_DB_NAME: succession
SUCC_DB_PASS: strongpassword
SUCC_DB_PORT: 13306
PERL5LIB: Succession/lib:$PERL5LIB
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest' ]
perl: [ 'latest' ]
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- name: Perl version
run: perl -V
- name: Setup database
run: mysql -u root -psekrit -h 127.0.0.1 -P"$SUCC_DB_PORT" -D $SUCC_DB_NAME < data/succession_dump.sql
- name: Wait for database
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"$SUCC_DB_PORT" --silent; do
sleep 1
done
- name: Check database
run: bin/db "select count(*) from sovereign"
- name: Install modules
run: cpanm -n --installdeps .
- name: Install coverage modules
run: cpanm -m Devel::Cover Devel::Cover::Report::Coveralls
- name: Run standard tests
if: matrix.os != 'ubuntu-latest'
run: prove -ISuccession/lib -v Succession/t
- name: Run coverage tests
if: matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HARNESS_PERL_SWITCHES: -MDevel::Cover
run: prove -ISuccession/lib -v Succession/t && cover -report Coveralls -ignore t/*