Skip to content

Commit

Permalink
Fix task names, use all currently supported PHP versions in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gdraynz committed May 24, 2024
1 parent 0584481 commit eae6d06
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Continuous integration

on:
workflow_dispatch: ~
push:
branches:
- develop
Expand All @@ -9,21 +10,27 @@ on:
branches:
- develop
- main
workflow_dispatch:

jobs:
ci:
name: Linting, tests and coverage
runs-on: ubuntu-22.04

strategy:
matrix:
php-version:
- 8.1
- 8.2
- 8.3

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 5.6
tools: composer:v1
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: Validate composer.json and composer.lock
run: composer validate
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM composer:2 as composer
FROM php:8.2-fpm
FROM php:8.3-fpm

ENV DEBIAN_FRONTEND noninteractive

Expand Down
11 changes: 8 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ tasks:
- cmd: task -l
silent: true

docker:build:
desc: Build the PHP test container
cmds:
- docker compose build

docker:remove:
desc: Remove PHP test container
cmds:
Expand All @@ -22,12 +27,12 @@ tasks:
cmds:
- docker compose run test-php /bin/bash

unit-test:
tests:
desc: Execute PHPUnit tests
cmds:
- docker compose run test-php ./vendor/bin/phpunit --testsuite "Alma PHP Client Unit Test Suite"

integration-test:
tests:integration:
desc: Execute intregration tests
cmds:
- docker compose run test-php ./vendor/bin/phpunit --testsuite "Alma PHP Client Integration Test Suite"
Expand All @@ -37,7 +42,7 @@ tasks:
cmds:
- docker compose run test-php ./vendor/bin/phpcs src/

fix:
lint:fix:
desc: Lint fix the php code
cmds:
- docker compose run test-php ./vendor/bin/phpcbf src/ tests/
10 changes: 3 additions & 7 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
services:
test-php:
container_name: test-php
user: ${UID:-1000}:${GID:-1000}
build:
context: ./
dockerfile: Dockerfile
user: ${UID:-1000}:${GID:-1000}
ports:
- "8080:80"
volumes:
- ./:/app
- /app/vendor
ports:
- "8080:80"
restart: unless-stopped
stdin_open: true
tty: true

0 comments on commit eae6d06

Please sign in to comment.