Skip to content

ci: Update .github/workflows/copilot-setup-steps.yml #26

ci: Update .github/workflows/copilot-setup-steps.yml

ci: Update .github/workflows/copilot-setup-steps.yml #26

name: "Copilot Setup Steps"
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
CACHE_STORE: array
SESSION_DRIVER: array
QUEUE_CONNECTION: sync
ADMIN_EMAIL: "admin@cafe.pos"
ADMIN_NAME: "Administrator"
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }} # Set this secret in your repository settings.
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
contents: read
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
- name: Set up PHP
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4
with:
php-version: '8.4'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, intl, exif, mysqli, pdo_mysql, opcache
ini-values: opcache.enable=1, opcache.memory_consumption=128, opcache.max_accelerated_files=10000, post_max_size=256M, upload_max_filesize=256M, memory_limit=512M, max_execution_time=180
tools: composer, pint, phpstan
coverage: none
- name: Get composer cache directory
id: composer-cache-dir
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809
id: composer-cache
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer dependencies
run: |
composer install --no-interaction --no-progress --prefer-dist
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: "22"
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Cache npm dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm dependencies
run: |
npm ci --no-audit --no-fund
- name: Copy environment file
run: cp .env.example .env
- name: Generate app key
run: php artisan key:generate
- name: Create SQLite database file
run: |
mkdir -p database
[ -f database/database.sqlite ] || : > database/database.sqlite
- name: Run Migration
run: |
php artisan migrate --force --graceful --no-interaction -v
- name: Ensure ADMIN_PASSWORD for CI
run: |
if [ -z "${ADMIN_PASSWORD:-}" ] || [ "${#ADMIN_PASSWORD}" -lt 12 ]; then
pw="$(openssl rand -base64 24 | tr -d '\n')"
echo "ADMIN_PASSWORD=$pw" >> "$GITHUB_ENV"
fi
- name: Seed Database
run: |
php artisan db:seed --force --no-interaction
php artisan db:seed --class=AdminUserSeeder --force --no-interaction
- name: Link storage
run: |
php artisan storage:link --force
- name: Pint
run: |
pint -v
- name: PHPStan
run: |
phpstan analyse -c phpstan.neon -v