From 0dd72ba2db6532f217d07d84c24914d71f625b78 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 16 Feb 2024 16:37:33 +0900 Subject: [PATCH] chore: add workflows/phpunit.yml --- .github/workflows/phpunit.yml | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/phpunit.yml diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..b28d706 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,56 @@ +name: PHPUnit + +on: + push: + branches: [ "3.x" ] + pull_request: + branches: [ "3.x" ] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + name: PHP ${{ matrix.php-versions }} + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [ '7.3', '7.4', '8.0', '8.1', '8.2' ] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: composer, phive, phpunit + extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3, sqlsrv, oci8, pgsql + coverage: xdebug + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout + run: | + pwd + ls -l + export cwd=`pwd` + composer self-update + cd .. + pwd + ls -l + git clone -b 3.x https://github.com/kenjis/ci-app-for-ci-phpunit-test.git + cd ci-app-for-ci-phpunit-test + rm application/tests/_ci_phpunit_test + composer update --prefer-dist --no-progress + mv vendor/kenjis/ci-phpunit-test vendor/kenjis/ci-phpunit-test.tmp + mv "$cwd" vendor/kenjis/ci-phpunit-test + php install.php + git checkout -- application/tests/Bootstrap.php + + - name: Run test suite + run: | + cd application/tests + ../../vendor/bin/phpunit --coverage-text