From 0b093b51aca2272aac8fac2cb2f26d53c5028d8e Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 3 Jul 2022 07:05:26 +0900 Subject: [PATCH 1/4] chore: add language unit tests --- .github/workflows/phpunit-lang.yml | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/phpunit-lang.yml diff --git a/.github/workflows/phpunit-lang.yml b/.github/workflows/phpunit-lang.yml new file mode 100644 index 000000000..da0ad4dbb --- /dev/null +++ b/.github/workflows/phpunit-lang.yml @@ -0,0 +1,64 @@ +name: Language Unit Tests + +on: + pull_request: + branches: + - develop + paths: + - 'src/Language/**.php' + - '!src/Language/en/**.php' + - 'phpunit*' + - '.github/workflows/phpunit-lang.yml' + push: + branches: + - develop + paths: + - 'src/Language/**.php' + - '!src/Language/en/**.php' + - 'phpunit*' + - '.github/workflows/phpunit-lang.yml' + +jobs: + main: + name: Language Unit Tests + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: composer, phive, phpunit + extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3 + coverage: xdebug + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi + + - name: Test with PHPUnit + run: vendor/bin/phpunit --verbose --coverage-text --testsuite lang + env: + TERM: xterm-256color + TACHYCARDIA_MONITOR_GA: enabled From 476c632921223229277827b7939a4c92bf18e8c8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 3 Jul 2022 07:15:45 +0900 Subject: [PATCH 2/4] chore: change testsuite name --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 039cebd29..3b7aac678 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -41,7 +41,7 @@ ./tests ./tests/Language - + ./tests/Language From 99b4d6d6e8f29e1cf535f65839bf57b9eb386bb3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 3 Jul 2022 07:20:15 +0900 Subject: [PATCH 3/4] chore: coverage does not make sense --- .github/workflows/phpunit-lang.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit-lang.yml b/.github/workflows/phpunit-lang.yml index da0ad4dbb..979f6f8de 100644 --- a/.github/workflows/phpunit-lang.yml +++ b/.github/workflows/phpunit-lang.yml @@ -58,7 +58,7 @@ jobs: fi - name: Test with PHPUnit - run: vendor/bin/phpunit --verbose --coverage-text --testsuite lang + run: vendor/bin/phpunit --verbose --no-coverage --testsuite lang env: TERM: xterm-256color TACHYCARDIA_MONITOR_GA: enabled From 0f5fe5ee1d61c3bf39a01c5830e1bb9fb7bb5335 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 4 Jul 2022 07:35:09 +0900 Subject: [PATCH 4/4] chore: change PHP version Co-authored-by: MGatner --- .github/workflows/phpunit-lang.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit-lang.yml b/.github/workflows/phpunit-lang.yml index 979f6f8de..817f27e57 100644 --- a/.github/workflows/phpunit-lang.yml +++ b/.github/workflows/phpunit-lang.yml @@ -31,7 +31,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.1' tools: composer, phive, phpunit extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3 coverage: xdebug