From ad5acaf1ba2bf5fa93ba31352b6d49443449e514 Mon Sep 17 00:00:00 2001 From: Baptiste Leduc Date: Fri, 25 Oct 2019 11:40:47 +0200 Subject: [PATCH] Update GH workflow --- .github/actions/gitsplit/Dockerfile | 6 ++++ .github/actions/gitsplit/action.yml | 11 ++++++ .github/actions/gitsplit/entrypoint.sh | 3 ++ .github/workflows/CI.yml | 46 ++++++++++++++++++++++++++ composer.json | 2 +- 5 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/actions/gitsplit/Dockerfile create mode 100644 .github/actions/gitsplit/action.yml create mode 100755 .github/actions/gitsplit/entrypoint.sh diff --git a/.github/actions/gitsplit/Dockerfile b/.github/actions/gitsplit/Dockerfile new file mode 100644 index 0000000000..90f697dd7b --- /dev/null +++ b/.github/actions/gitsplit/Dockerfile @@ -0,0 +1,6 @@ +FROM jderusse/gitsplit:latest + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] + diff --git a/.github/actions/gitsplit/action.yml b/.github/actions/gitsplit/action.yml new file mode 100644 index 0000000000..7fb7fa2ddf --- /dev/null +++ b/.github/actions/gitsplit/action.yml @@ -0,0 +1,11 @@ +name: 'gitsplit' +description: 'Will gitsplit your repository' +inputs: + gh-token: + description: 'GitHub Token' + required: true +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.gh-token }} diff --git a/.github/actions/gitsplit/entrypoint.sh b/.github/actions/gitsplit/entrypoint.sh new file mode 100755 index 0000000000..e734f7ebe0 --- /dev/null +++ b/.github/actions/gitsplit/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh -l + +echo "Hello $1" diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 356fc700f9..6906f5ba49 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,3 +10,49 @@ jobs: uses: docker://oskarstark/php-cs-fixer-ga with: args: '--dry-run --diff' + tests: + runs-on: ubuntu-latest + strategy: + max-parallel: 15 + matrix: + php-versions: ['7.2', '7.3', '7.4'] + name: tests-${{ matrix.php-versions }} + steps: + - name: checkout + uses: actions/checkout@master + - name: setup + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-versions }} + extension-csv: mbstring, fileinfo, json, intl, dom + - name: install + run: composer install + - name: tests + run: composer test + coverage: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@master + - name: setup + uses: shivammathur/setup-php@master + with: + php-version: 7.2 + extension-csv: mbstring, fileinfo, json, intl, dom + - name: coveralls-setup + run: wget https://github.com/php-coveralls/php-coveralls/releases/download/v1.0.2/coveralls.phar && chmod +x coveralls.phar + - name: install + run: composer install + - name: tests + run: composer test-coverage + - name: coveralls-sync + run: ./coveralls.phar -v + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + gitsplit: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@master + - name: gitsplit + uses: ./.github/actions/gitsplit diff --git a/composer.json b/composer.json index 8fb4f6b07e..f74cb86d67 100644 --- a/composer.json +++ b/composer.json @@ -76,6 +76,6 @@ ], "scripts": { "test": "php vendor/bin/phpunit", - "test-ci": "phpdbg -qrr -d memory_limit=-1 vendor/bin/phpunit --coverage-text --coverage-clover=build/logs/clover.xml --coverage-html=build/html" + "test-coverage": "phpdbg -qrr -d memory_limit=-1 vendor/bin/phpunit --coverage-text --coverage-clover=build/logs/clover.xml --coverage-html=build/html" } }