From bc03287949f870fa5a5dac397bfec13f1c424159 Mon Sep 17 00:00:00 2001 From: Refringe Date: Tue, 18 Jun 2024 16:18:27 -0400 Subject: [PATCH] Separates Test and Quality Workflows --- .github/README.md | 3 +- .../workflows/{general.yaml => quality.yaml} | 65 +----------------- .github/workflows/tests.yaml | 67 +++++++++++++++++++ 3 files changed, 70 insertions(+), 65 deletions(-) rename .github/workflows/{general.yaml => quality.yaml} (60%) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/README.md b/.github/README.md index 92fc86f..e696b73 100644 --- a/.github/README.md +++ b/.github/README.md @@ -2,7 +2,8 @@

The Forge

License: MPL 2.0 -Actions Status +Quality Control Action Status +Test Action Status Discord Chat Patreon Fund

diff --git a/.github/workflows/general.yaml b/.github/workflows/quality.yaml similarity index 60% rename from .github/workflows/general.yaml rename to .github/workflows/quality.yaml index dabd501..1d241a8 100644 --- a/.github/workflows/general.yaml +++ b/.github/workflows/quality.yaml @@ -1,4 +1,4 @@ -name: General Workflow +name: Quality on: [ push, pull_request ] @@ -96,66 +96,3 @@ jobs: commit_user_name: Pint Bot skip_fetch: true file_pattern: '*.php' - - laravel-tests: - runs-on: ubuntu-24.04 - services: - mysql: - image: mysql:8.3 - env: - MYSQL_DATABASE: testing - MYSQL_USER: user - MYSQL_PASSWORD: password - MYSQL_ROOT_PASSWORD: password - ports: - - 33306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - extensions: mbstring, dom, fileinfo - coverage: none - - name: Configure Laravel Nova Authentication - shell: bash - env: - NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} - NOVA_LICENSE_KEY: ${{ secrets.NOVA_LICENSE_KEY }} - run: composer config http-basic.nova.laravel.com "$NOVA_USERNAME" "$NOVA_LICENSE_KEY" - - name: Get Composer Cache Directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - name: Cache composer dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install Composer Dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - name: Get NPM Cache Directory - id: npm-cache - run: echo "::set-output name=dir::$(npm config get cache)" - - name: Cache NPM Dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.npm-cache.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-node- - - name: Install npm dependencies - run: npm ci - - name: Prepare Laravel Environment - run: | - php -r "file_exists('.env') || copy('.env.ci', '.env');" - php artisan key:generate - php artisan config:cache - php artisan route:cache - - name: Run Database Migrations - run: php artisan migrate - - name: Link Storage - run: php artisan storage:link - - name: Run Tests - run: php artisan test diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..185114a --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,67 @@ +name: Tests + +on: [ push, pull_request ] + +jobs: + laravel-tests: + runs-on: ubuntu-24.04 + services: + mysql: + image: mysql:8.3 + env: + MYSQL_DATABASE: testing + MYSQL_USER: user + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: password + ports: + - 33306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + extensions: mbstring, dom, fileinfo + coverage: none + - name: Configure Laravel Nova Authentication + shell: bash + env: + NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} + NOVA_LICENSE_KEY: ${{ secrets.NOVA_LICENSE_KEY }} + run: composer config http-basic.nova.laravel.com "$NOVA_USERNAME" "$NOVA_LICENSE_KEY" + - name: Get Composer Cache Directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - name: Cache composer dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install Composer Dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Get NPM Cache Directory + id: npm-cache + run: echo "::set-output name=dir::$(npm config get cache)" + - name: Cache NPM Dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.npm-cache.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node- + - name: Install npm dependencies + run: npm ci + - name: Prepare Laravel Environment + run: | + php -r "file_exists('.env') || copy('.env.ci', '.env');" + php artisan key:generate + php artisan config:cache + php artisan route:cache + - name: Run Database Migrations + run: php artisan migrate + - name: Link Storage + run: php artisan storage:link + - name: Run Tests + run: php artisan test