Skip to content

Commit

Permalink
setup github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasfranck committed Aug 20, 2024
1 parent 07018b6 commit e4b27af
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: test
on: [push, pull_request]
jobs:
container-job:
runs-on: ubuntu-latest
container: node:16-bullseye

build:
runs-on: ubuntu-latest
strategy:
matrix:
perl:
[
"5.38",
"5.36",
"5.34",
"5.32",
"5.30",
"5.22",
]
name: Perl ${{ matrix.perl }}
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DATABASE: catmandu_dbi
POSTGRES_USER: catmandu_dbi
POSTGRES_PASSWORD: catmandu_dbi
# see section on PGDATA in https://hub.docker.com/_/postgres
PGDATA: /var/lib/postgresql/data/pgdata
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Setup perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- name: Install dependencies
run: cpanm -nq --installdeps --with-develop --with-recommends --with-all-features .
- name: Run test
shell: bash
run: |
export CATMANDU_DBI_TEST_PG_DSN="dbi:Pg:dbname=catmandu_dbi;host=postgres"
export CATMANDU_DBI_TEST_PG_USERNAME=catmandu_dbi
export CATMANDU_DBI_TEST_PG_PASSWORD=catmandu_dbi
prove -lr t
12 changes: 12 additions & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ on 'test', sub {
requires 'Test::Exception','0';
requires 'Test::More','0';
};

feature 'sqlite', 'SQLite support' => sub {
recommends 'DBD::SQLite';
};

feature 'mysql', 'Mysql support' => sub {
recommends 'DBD::mysql';
};

feature 'postgres', 'Postgres support' => sub {
recommends 'DBD::Pg';
};

0 comments on commit e4b27af

Please sign in to comment.