From 15f25799c6261cf5ba758de20da5150bc748cf66 Mon Sep 17 00:00:00 2001 From: Henry Whitaker Date: Sat, 15 Aug 2020 16:41:07 +0100 Subject: [PATCH] Updated workflows --- .github/workflows/laravel-dev.yml | 23 +++++++++----- .github/workflows/laravel-pr.yml | 47 ++++++++++++++++++++++++++++ .github/workflows/laravel-stable.yml | 23 +++++++++----- 3 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/laravel-pr.yml diff --git a/.github/workflows/laravel-dev.yml b/.github/workflows/laravel-dev.yml index 79f6b668..74d07a6f 100644 --- a/.github/workflows/laravel-dev.yml +++ b/.github/workflows/laravel-dev.yml @@ -4,7 +4,7 @@ on: push: branches: [ dev ] pull_request: - branches: [ dev ] + branches: [ ] jobs: laravel-tests: @@ -17,19 +17,28 @@ jobs: run: php -r "file_exists('.env') || copy('.env.example', '.env');" - name: Install Dependencies run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Generate key - run: php artisan key:generate - - name: Generate JWT key - run: php artisan jwt:secret - - name: Directory Permissions - run: chmod -R 777 storage bootstrap/cache - name: Create Database run: | mkdir -p database touch database/database.sqlite + - name: Generate key + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: php artisan key:generate + - name: Generate JWT key + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: php artisan jwt:secret + - name: Directory Permissions + run: chmod -R 777 storage bootstrap/cache - name: Download Speedtest binary run: wget https://bintray.com/ookla/download/download_file?file_path=ookla-speedtest-1.0.0-x86_64-linux.tgz -O speedtest.tgz && tar zxvf speedtest.tgz && mv speedtest app/Bin/ - name: Accept EULA + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite run: php artisan speedtest:eula - name: Execute tests (Unit and Feature tests) via PHPUnit env: diff --git a/.github/workflows/laravel-pr.yml b/.github/workflows/laravel-pr.yml new file mode 100644 index 00000000..7f107e24 --- /dev/null +++ b/.github/workflows/laravel-pr.yml @@ -0,0 +1,47 @@ +name: PR + +on: + push: + branches: [ ] + pull_request: + branches: [ master, dev, alpha ] + +jobs: + laravel-tests: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Copy .env + run: php -r "file_exists('.env') || copy('.env.example', '.env');" + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Create Database + run: | + mkdir -p database + touch database/database.sqlite + - name: Generate key + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: php artisan key:generate + - name: Generate JWT key + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: php artisan jwt:secret + - name: Directory Permissions + run: chmod -R 777 storage bootstrap/cache + - name: Download Speedtest binary + run: wget https://bintray.com/ookla/download/download_file?file_path=ookla-speedtest-1.0.0-x86_64-linux.tgz -O speedtest.tgz && tar zxvf speedtest.tgz && mv speedtest app/Bin/ + - name: Accept EULA + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: php artisan speedtest:eula + - name: Execute tests (Unit and Feature tests) via PHPUnit + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: vendor/bin/phpunit diff --git a/.github/workflows/laravel-stable.yml b/.github/workflows/laravel-stable.yml index 4505f253..83a75544 100644 --- a/.github/workflows/laravel-stable.yml +++ b/.github/workflows/laravel-stable.yml @@ -4,7 +4,7 @@ on: push: branches: [ master ] pull_request: - branches: [ master ] + branches: [ ] jobs: laravel-tests: @@ -17,19 +17,28 @@ jobs: run: php -r "file_exists('.env') || copy('.env.example', '.env');" - name: Install Dependencies run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Generate key - run: php artisan key:generate - - name: Generate JWT key - run: php artisan jwt:secret - - name: Directory Permissions - run: chmod -R 777 storage bootstrap/cache - name: Create Database run: | mkdir -p database touch database/database.sqlite + - name: Generate key + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: php artisan key:generate + - name: Generate JWT key + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite + run: php artisan jwt:secret + - name: Directory Permissions + run: chmod -R 777 storage bootstrap/cache - name: Download Speedtest binary run: wget https://bintray.com/ookla/download/download_file?file_path=ookla-speedtest-1.0.0-x86_64-linux.tgz -O speedtest.tgz && tar zxvf speedtest.tgz && mv speedtest app/Bin/ - name: Accept EULA + env: + DB_CONNECTION: sqlite + DB_DATABASE: database/database.sqlite run: php artisan speedtest:eula - name: Execute tests (Unit and Feature tests) via PHPUnit env: