This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
Merge pull request #182 from lightszentip/renovate/patch-all-patch #137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
tags: | |
- '*' | |
branches: | |
- 'main' | |
jobs: | |
cibuild: | |
runs-on: ubuntu-latest | |
name: CI Build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.0 | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite | |
coverage: none | |
- name: Install Composer dependencies | |
run: composer install --prefer-dist --no-interaction --no-suggest --optimize-autoloader | |
- name: Install NPM dependencies | |
run: npm install | |
- name: Compile assets | |
run: npm run production | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Generate key | |
run: php artisan key:generate | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Create Database | |
run: | | |
mkdir -p database | |
touch database/database.sqlite | |
- name: Execute tests (Unit and Feature tests) via PHPUnit | |
env: | |
DB_CONNECTION: sqlite | |
DB_DATABASE: database/database.sqlite | |
run: vendor/bin/phpunit | |
# - name: Execute the PHP lint script 🧹 | |
# run: | | |
# ./vendor/bin/phpstan --version | |
# ./vendor/bin/phpstan analyse | |
# | |
- name: Run security checks 👮 | |
uses: symfonycorp/security-checker-action@v5 | |
- name: Remove .env | |
run: rm .env | |
- name: Build project | |
run: mkdir build | |
- name: Create artifact | |
uses: montudor/[email protected] | |
with: | |
args: zip -X -r build/giftlist.zip . -x *.git* -x .github/* -x ./node_modules/* | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: giftlist | |
path: build/giftlist.zip | |
- name: "Build Changelog" | |
id: build_changelog | |
uses: mikepenz/[email protected] | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/giftlist.zip | |
asset_name: giftlist.zip | |
prerelease: true | |
release_name: v${{ github.ref }} | |
tag: ${{ github.ref }} | |
overwrite: true | |
body: ${{steps.build_changelog.outputs.changelog}} | |
- name: Upload logs on build failure 🪵 | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: Laravel Logs | |
path: ./storage/logs |