Skip to content

Commit

Permalink
[TASK] Run acceptence test in github actions with different PHP Versions
Browse files Browse the repository at this point in the history
  • Loading branch information
extcode committed Jun 6, 2024
1 parent 6e71be3 commit c8fbb3a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Code Quality (by PHPStan)
run: vendor/bin/phpstan analyse -c Build/phpstan.neon

tests-acceptance:
tests-acceptance-php81:
runs-on: ubuntu-latest
needs:
- coding-guideline
Expand All @@ -91,5 +91,11 @@ jobs:
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Run Acceptance Tests
run: nix-shell --pure --run project-test-acceptance
- name: Run Acceptance Tests PHP8.1
run: nix-shell --pure --run project-test-acceptance

- name: Run Acceptance Tests PHP8.2
run: nix-shell --arg phpVersion \"php82\" --pure --run project-test-acceptance

- name: Run Acceptance Tests PHP8.3
run: nix-shell --arg phpVersion \"php83\" --pure --run project-test-acceptance
14 changes: 10 additions & 4 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{ pkgs ? import <nixpkgs> { } }:
{
pkgs ? import <nixpkgs> { }
,phpVersion ? "php81"
}:

let
php = pkgs.php81.buildEnv {
php = pkgs.${phpVersion}.buildEnv {
extensions = { enabled, all }: enabled ++ (with all; [
xdebug
]);
Expand All @@ -11,7 +14,7 @@ let
memory_limit = 4G
'';
};
inherit(pkgs.php81Packages) composer;
inherit(pkgs."${phpVersion}Packages") composer;

projectInstall = pkgs.writeShellApplication {
name = "project-install";
Expand Down Expand Up @@ -56,6 +59,7 @@ let
pkgs.sqlite
pkgs.firefox
pkgs.geckodriver
pkgs.procps
php
];
text = ''
Expand All @@ -69,6 +73,8 @@ let
export INSTANCE_PATH="$PROJECT_ROOT/.build/web/typo3temp/var/tests/acceptance"
./vendor/bin/codecept run
pgrep -f "php -S" | xargs -r kill
'';
};

Expand All @@ -88,4 +94,4 @@ in pkgs.mkShellNoCC {
export typo3DatabaseDriver=pdo_sqlite
'';
}
}

0 comments on commit c8fbb3a

Please sign in to comment.