Skip to content

Commit

Permalink
Merge pull request #37 from Yozhef/updateCi
Browse files Browse the repository at this point in the history
feat: update ci process
  • Loading branch information
Yozhef authored Dec 13, 2021
2 parents 7f67a12 + 10d6518 commit 270e5aa
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 56 deletions.
90 changes: 42 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,56 @@
name: Build

on:
push: ~
pull_request: ~
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
push:
pull_request:
types: [opened, synchronize, edited, reopened]

jobs:
tests:
runs-on: ubuntu-latest

continue-on-error: false
name: "PHP ${{ matrix.php }}"

strategy:
fail-fast: false
matrix:
php: [8.0, 7.4, 7.3, 7.2]
php:
- '7.4'
- '8.0'
- '8.1'

steps:
-
uses: actions/checkout@v2

-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none

-
name: Run Chrome Headless
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &

-
name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

-
name: Cache Composer
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
-
name: Install PHP dependencies
run: composer install --no-interaction

-
name: Validate composer.json
run: composer validate --ansi --strict

-
name: Run Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
ini-values: "memory_limit=-1"
php-version: ${{ matrix.php }}
tools: composer:v2

- name: Run Chrome Headless
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
- name: Install PHP dependencies
run: composer install --no-interaction

- name: Validate composer.json
run: composer validate --ansi --strict

- name: Run Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": "^7.2 || ^8.0",
"php": ">=7.4",
"behat/behat": "^3.5",
"behat/mink-extension": "^2.3"
},
Expand Down
6 changes: 3 additions & 3 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
final class FeatureContext implements Context
{
/** @var string */
private $phpBin;
private string $phpBin;

/** @var array<string, string> */
private $configuration = ['%clean_start%' => 'true'];
private array $configuration = ['%clean_start%' => 'true'];

/** @var string */
private $testApplicationDir;
private string $testApplicationDir;

/**
* @BeforeScenario
Expand Down
8 changes: 4 additions & 4 deletions src/Listener/FailedStepListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ final class FailedStepListener implements EventSubscriberInterface
/**
* @var Mink
*/
private $mink;
private Mink $mink;

/**
* @var string
*/
private $logDirectory;
private string $logDirectory;

/**
* @var bool
*/
private $screenshot;
private bool $screenshot;

/**
* Used to ensure that screenshot and log comes from the same failed step.
*
* @var string
*/
private $currentDateAsString;
private string $currentDateAsString;

public function __construct(Mink $mink, string $logDirectory, bool $screenshot)
{
Expand Down

0 comments on commit 270e5aa

Please sign in to comment.