72 lines (68 loc) · 2.34 KB
/
perltest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# 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="healthcheck.sh --connect --innodb_initialized" --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 -n 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/*