Skip to content

Commit

Permalink
Test Package on Laravel 9 (#7)
Browse files Browse the repository at this point in the history
* Test Package on Laravel 9

* Set loadEnvironmentVariables to true

* Update Workflow

* Don't fill .env file

* Update testbench.example.yaml
  • Loading branch information
stefanzweifel authored Mar 6, 2022
1 parent 2865087 commit bcdb1fb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ jobs:
matrix:
os: [ubuntu-latest]
php: [8.0, 8.1]
laravel: [8.*]
laravel: [8.*, 9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: ^6.23
- laravel: 9.*
testbench: ^7.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand All @@ -41,20 +43,14 @@ jobs:
# Secrets used by vendor/bin/testbench have to be declared inside testbench.yaml. env() can't be used.
- name: Setup Testbench
run: |
echo "env:
- SIDECAR_ACCESS_KEY_ID: ${{secrets.SIDECAR_ACCESS_KEY_ID}}
- SIDECAR_SECRET_ACCESS_KEY: ${{secrets.SIDECAR_SECRET_ACCESS_KEY}}
- SIDECAR_REGION: ${{secrets.SIDECAR_REGION}}
- SIDECAR_ARTIFACT_BUCKET_NAME: ${{secrets.SIDECAR_ARTIFACT_BUCKET_NAME}}
- SIDECAR_EXECUTION_ROLE: ${{secrets.SIDECAR_EXECUTION_ROLE}}
echo "
providers:
- Hammerstone\Sidecar\Providers\SidecarServiceProvider
- Wnx\SidecarBrowsershot\SidecarBrowsershotServiceProvider" >> testbench.yaml
# Deploy Lambda function before running the test suite.
- name: Deploy Lambda function
run: vendor/bin/testbench sidecar-browsershot:setup --no-interaction
run: vendor/bin/testbench sidecar-browsershot:setup --no-interaction -vvv
env:
SIDECAR_ACCESS_KEY_ID: ${{secrets.SIDECAR_ACCESS_KEY_ID}}
SIDECAR_SECRET_ACCESS_KEY: ${{secrets.SIDECAR_SECRET_ACCESS_KEY}}
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"spatie/laravel-package-tools": "^1.9.2"
},
"require-dev": {
"nunomaduro/collision": "^5.10",
"nunomaduro/larastan": "^1.0",
"orchestra/testbench": "^6.22",
"nunomaduro/collision": "^5.10|^6.0",
"nunomaduro/larastan": "^1.0|^2.0",
"orchestra/testbench": "^6.22|^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"phpstan/extension-installer": "^1.1",
Expand Down
7 changes: 0 additions & 7 deletions testbench.example.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
env:
- SIDECAR_ACCESS_KEY_ID=
- SIDECAR_SECRET_ACCESS_KEY=
- SIDECAR_REGION=
- SIDECAR_ARTIFACT_BUCKET_NAME=
- SIDECAR_EXECUTION_ROLE=

providers:
- Hammerstone\Sidecar\Providers\SidecarServiceProvider
- Wnx\SidecarBrowsershot\SidecarBrowsershotServiceProvider
2 changes: 2 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

class TestCase extends Orchestra
{
protected $loadEnvironmentVariables = true;

protected function getPackageProviders($app)
{
return [
Expand Down

0 comments on commit bcdb1fb

Please sign in to comment.