From 348dbbd66aae7d8196509fddaa5c48c605dbdfc0 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 19 Oct 2021 20:34:23 +0100 Subject: [PATCH 1/2] add linting and build steps --- composer.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/composer.json b/composer.json index 3584731..f700fd3 100644 --- a/composer.json +++ b/composer.json @@ -17,5 +17,16 @@ "psr-0": { "ForceUTF8\\": "src/" } + }, + "scripts" : { + "build": [ + "@lint", + "@test" + ], + "lint" : "@php vendor/bin/parallel-lint src", + "test" : "@php test/ForceUTF8Test.php" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.3" } } From f8432c93c7ce29ff40131859656559abe5555b4a Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 19 Oct 2021 20:34:39 +0100 Subject: [PATCH 2/2] add github action - covering php 5.6+ --- .github/workflows/php.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..438d746 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,32 @@ +name: GitHub Action +on: + push: + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ["5.6", "7.0", "7.1", "7.2", "7.4", "8.0" ] + + steps: + - uses: actions/checkout@v2 + + - name: setup php + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: intl, iconv, mbstring + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run linter + run: composer lint + + - name: Run tests + run: composer test