Skip to content

Commit

Permalink
Setup database in coverage job
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Nov 29, 2022
1 parent 2772acc commit 0c45858
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/perltest.yml
Expand Up @@ -62,20 +62,34 @@ jobs:
run: prove -ISuccession/lib -v Succession/t

coverage:
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
runs-on: ubuntu-latest
container: davorg/perl-coveralls:latest
name: Test coverage
steps:
- uses: actions/checkout@v3
- 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: Install modules
run: cpanm -n --installdeps .
- name: Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HARNESS_PERL_SWITCHES: -MDevel::Cover
SUCC_DB_USER: succession
SUCC_DB_HOST: 127.0.0.1
SUCC_DB_NAME: succession
SUCC_DB_PASS: strongpassword
SUCC_DB_PORT: 13306
run: prove -ISuccession/lib -v Succession/t && cover -report Coveralls -ignore t/*

0 comments on commit 0c45858

Please sign in to comment.