WIP
This commit is contained in:
46
.github/workflows/main.yml
vendored
Normal file
46
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Run tests & build files
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main-prepare
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run tests
|
||||
uses: ploi-deploy/ploi-core/.github/workflows/run-tests.yml@main-prepare
|
||||
|
||||
deploy:
|
||||
needs: test
|
||||
name: Prepare build assets
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup PHP with PECL extension
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
extensions: pcntl
|
||||
|
||||
- run: composer install
|
||||
name: Install dependencies
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- run: npm install
|
||||
- run: rm -f public/mix-manifest.json
|
||||
- run: npm run prod --section=frontend
|
||||
- run: npm run prod --section=admin
|
||||
|
||||
- name: Commit build assets
|
||||
run: |
|
||||
git config --local user.email "actions@github.com"
|
||||
git config --local user.name "GitHub Actions"
|
||||
git checkout -B main-files main-prepare
|
||||
git add -f public/
|
||||
git commit -m "Run Laravel Mix en build front-end assets"
|
||||
git checkout -B main
|
||||
git merge main-files
|
||||
git push -f origin main
|
||||
50
.github/workflows/run-tests.yml
vendored
Normal file
50
.github/workflows/run-tests.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: "Run tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: PHPUnit
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
env:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
MYSQL_DATABASE: XXX
|
||||
ports:
|
||||
- 3306/tcp
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.1
|
||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, mysql
|
||||
coverage: none
|
||||
|
||||
- name: Start mysql service
|
||||
run: sudo systemctl start mysql
|
||||
|
||||
- name: Setup problem matchers
|
||||
run: |
|
||||
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
|
||||
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer upgrade -W --no-interaction --prefer-dist
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/pest
|
||||
env:
|
||||
DB_PASSWORD_TEST: password
|
||||
DB_PORT_TEST: ${{ job.services.mysql.ports['3306'] }}
|
||||
DB_DATABASE_TEST: XXX
|
||||
Reference in New Issue
Block a user