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

Use GitHub actions and own containers #114

Merged
merged 9 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
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
36 changes: 36 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Tests

on:
push:

jobs:
run:
runs-on: "ubuntu-latest"

strategy:
matrix:
powerdns-versions: ['42', '43', '44', '45', '46', '47']
php-versions: ['7.3', '7.4', '8.0', '8.1']

services:
powerdns:
image: registry.exonet.nl/exonet/powerdns-test:${{ matrix.powerdns-versions}}
ports:
- 8081:8081

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: json

- name: Install dependencies
run: composer install --prefer-dist

- name: Run tests
run: ./vendor/bin/phpunit
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

90 changes: 23 additions & 67 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,37 @@
version: "3.7"
services:
powerdns41:
image: psitrax/powerdns:4.1
container_name: pdns41
environment:
MYSQL_USER: root
MYSQL_PASS: verySecretPassword
MYSQL_HOST: db-pdns41
depends_on:
- db-pdns41
ports:
- 8041:8081
volumes:
- ./.docker/powerdns:/etc/pdns/conf.d

db-pdns41:
image: mysql:5.7
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: verySecretPassword

powerdns42:
image: psitrax/powerdns:v4.2
container_name: pdns42
environment:
MYSQL_USER: root
MYSQL_PASS: verySecretPassword
MYSQL_HOST: db-pdns42
depends_on:
- db-pdns42
image: registry.exonet.nl/exonet/powerdns-test:42
ports:
- 8042:8081
volumes:
- ./.docker/powerdns:/etc/pdns/conf.d

db-pdns42:
image: mysql:5.7
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: verySecretPassword
- "8042:8081"

powerdns43:
image: psitrax/powerdns:v4.3
container_name: pdns43
environment:
MYSQL_USER: root
MYSQL_PASS: verySecretPassword
MYSQL_HOST: db-pdns43
depends_on:
- db-pdns43
image: registry.exonet.nl/exonet/powerdns-test:43
ports:
- 8043:8081
volumes:
- ./.docker/powerdns:/etc/pdns/conf.d

db-pdns43:
image: mysql:5.7
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: verySecretPassword
- "8043:8081"

powerdns44:
image: psitrax/powerdns:v4.4
container_name: pdns44
environment:
MYSQL_USER: root
MYSQL_PASS: verySecretPassword
MYSQL_HOST: db-pdns44
depends_on:
- db-pdns44
image: registry.exonet.nl/exonet/powerdns-test:44
ports:
- 8044:8081
volumes:
- ./.docker/powerdns44:/etc/pdns/conf.d
- "8044:8081"

db-pdns44:
image: mysql:5.7
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: verySecretPassword
powerdns45:
container_name: pdns45
image: registry.exonet.nl/exonet/powerdns-test:45
ports:
- "8045:8081"

powerdns46:
container_name: pdns46
image: registry.exonet.nl/exonet/powerdns-test:46
ports:
- "8046:8081"

powerdns47:
container_name: pdns47
image: registry.exonet.nl/exonet/powerdns-test:47
ports:
- "8047:8081"
6 changes: 3 additions & 3 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ if [ "$#" -eq 2 ]; then
else
# Run tests for all supported PHP 7 / PowerDNS 4 combinations.
for phpversion in {3..4}; do
for pdnsversion in {1..4}; do
for pdnsversion in {2..7}; do
run "7.$phpversion" "4.$pdnsversion"
done
RESULTS="$RESULTS\n"
done
# Run tests for all supported PHP 8 / PowerDNS 4 combinations.
for phpversion in {0..0}; do
for pdnsversion in {1..4}; do
for phpversion in {0..1}; do
for pdnsversion in {2..7}; do
run "8.$phpversion" "4.$pdnsversion"
done
RESULTS="$RESULTS\n"
Expand Down
1 change: 1 addition & 0 deletions src/Resources/ResourceSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public function offsetExists($offset): bool
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->resourceRecords[$offset];
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ protected function setUp(): void

$host = getenv('PDNS_HOST') ?: '127.0.0.1';

$this->powerdns = new Powerdns($host, 'apiKey', 8081);
$this->powerdns = new Powerdns($host, 'secret', 8081);
}
}