Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions #115

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/with_pg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI in Docker container

on:
push:
pull_request:
workflow_dispatch:
# schedule:
# - cron: '42 5 * * *'

jobs:
test:
strategy:
fail-fast: false
matrix:
perl: [ '5.30', '5.36' ]
postgres: [ '11', 'latest' ]

services:
postgreshost:
image: postgres:${{matrix.postgres}}
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_secret
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5


runs-on: ubuntu-latest
container: perl:${{ matrix.perl }}

steps:
- uses: actions/checkout@v3

- name: Show Perl Version
run: |
perl -v

- name: Install non-perl dependencies
run: |
apt-get update
apt-get install -y libaspell-dev

- name: Install Modules
run: |
cpanm -v
cpanm --installdeps --notest .
cpanm --notest Perl::Critic Text::SpellChecker

- name: Show Errors on Ubuntu
if: ${{ failure() && startsWith( matrix.runner, 'ubuntu-')}}
run: |
cat /home/runner/.cpanm/work/*/build.log

- name: Run make
run: |
perl Makefile.PL
make

- name: Run tests
env:
AUTHOR_TESTING: 1
RELEASE_TESTING: 1
DBI_DSN: "dbi:Pg:dbname=test_db;host=postgreshost"
DBI_PASS: test_secret
DBI_USER: test_user
run: |
make test