mirror of
https://gh.wpcy.net/https://github.com/wp-cli/profile-command.git
synced 2026-04-17 14:32:21 +08:00
44 lines
1.5 KiB
YAML
44 lines
1.5 KiB
YAML
name: "Copilot Setup Steps"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- .github/workflows/copilot-setup-steps.yml
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/copilot-setup-steps.yml
|
|
|
|
jobs:
|
|
copilot-setup-steps:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Check existence of composer.json file
|
|
id: check_composer_file
|
|
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up PHP environment
|
|
if: steps.check_composer_file.outputs.files_exists == 'true'
|
|
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2
|
|
with:
|
|
php-version: 'latest'
|
|
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
|
|
coverage: 'none'
|
|
tools: composer,cs2pr
|
|
env:
|
|
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Composer dependencies & cache dependencies
|
|
if: steps.check_composer_file.outputs.files_exists == 'true'
|
|
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v3
|
|
env:
|
|
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
|
|
with:
|
|
# Bust the cache at least once a month - output format: YYYY-MM.
|
|
custom-cache-suffix: $(date -u "+%Y-%m")
|