Skip to content

Instantly share code, notes, and snippets.

@kenng
Last active July 19, 2021 04:51
Show Gist options
  • Save kenng/892ffb4f2a858e44ff69c3608fb22a8b to your computer and use it in GitHub Desktop.
Save kenng/892ffb4f2a858e44ff69c3608fb22a8b to your computer and use it in GitHub Desktop.

Revisions

  1. Ken Ng revised this gist Jul 19, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion testing.yml
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ jobs:
    composer install
    - name: Prepare Laravel Application
    run: |
    cp .env.example .env
    cp .env.testing .env
    php artisan key:generate
    - name: Migrate and seed
    run: |
  2. Ken Ng created this gist Jul 19, 2021.
    52 changes: 52 additions & 0 deletions testing.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    name: Laravel testing

    on:
    push:
    branches:
    - release

    jobs:
    phpunit:
    runs-on: ubuntu-20.04
    strategy:
    fail-fast: true

    container:
    image: kenngsimply/laravelapp:v1

    services:
    db-tests:
    image: mysql:5.7
    env:
    MYSQL_ROOT_PASSWORD: <YOUR-ROOT-PASSWORD>
    MYSQL_USER: <YOUR-DB-USER>
    MYSQL_PASSWORD: <YOUR-DB-USER-PASSWOD>
    MYSQL_DATABASE: <YOUR-DB-NAME>
    ports:
    - 3306:3306
    redis:
    image: redis:6-alpine
    ports:
    - 6379:6379

    steps:
    - name: Checkout
    uses: actions/checkout@v2
    with:
    fetch-depth: 1

    - name: Install composer dependencies
    run: |
    composer install
    - name: Prepare Laravel Application
    run: |
    cp .env.example .env
    php artisan key:generate
    - name: Migrate and seed
    run: |
    php artisan migrate --seed
    - name:
    run: |
    php artisan redis:init
    - name: Run Testsuite
    run: php artisan test