From 99be5563cb917205d8371c14d7cb1b0b93c7f22d Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 21 Jan 2021 10:30:33 -0800 Subject: [PATCH 1/4] Create php.yml --- .github/workflows/php.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 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..ca04881 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,36 @@ +name: PHP Composer + +on: + push: + pull_request: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + - name: Tests + run: vendor/bin/phpunit + # - name: Run test suite + # run: composer run-script test From e2c826fd0d0a5468e77884b83368d35ae5c36dc8 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 21 Jan 2021 10:41:32 -0800 Subject: [PATCH 2/4] Create tests.yml --- .github/workflows/tests.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..84e01a6 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,48 @@ +name: Tests + +on: + push: + branches: [ 0.x ] + pull_request: + branches: [ 0.x ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.3', '7.4', '8.0'] + + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ matrix-php }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ matrix.php }}-composer- + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + extensions: "json,sodium" + php-version: "${{ matrix.php }}" + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + - name: Run tests + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + - name: Run tests + run: vendor/bin/phpunit -v + + # - name: Run test suite + # run: composer run-script test From 0b84512379674556d9a32f5b06bff050d33003d5 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 21 Jan 2021 10:43:31 -0800 Subject: [PATCH 3/4] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84e01a6..34ea6bb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,7 @@ jobs: - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true' run: composer install --prefer-dist --no-progress --no-suggest - - name: Run tests + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" # Docs: https://getcomposer.org/doc/articles/scripts.md - name: Run tests From d5af5a14ba0828999a004e2b84a9a7d4142ac2d1 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 21 Jan 2021 10:48:53 -0800 Subject: [PATCH 4/4] Update php.yml --- .github/workflows/php.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ca04881..1384604 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -2,7 +2,9 @@ name: PHP Composer on: push: + branches: [ master, 1.x ] pull_request: + branches: [ master, 1.x ] jobs: build: