[3.0] 更新环境 CI #3332
Workflow file for this run
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: Coding Standards | |
on: | |
push: | |
paths-ignore: | |
- "doc/**" | |
- "mddoc/**" | |
- "res/**" | |
- "website/**" | |
- ".markdownlint.json" | |
- "README.md" | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
env: | |
REPOSITORY_OWNER: ${{ github.repository_owner }} | |
IMAGE_VERSION: php8.1-swoole-5.0 | |
ENV_SERVICE: swoole-only | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare1 | |
run: | | |
echo "REPOSITORY_OWNER=${REPOSITORY_OWNER,,}" >>${GITHUB_ENV} | |
mkdir -p /tmp/base_cache/composer | |
mkdir -p /tmp/base_cache/phpcsfixer | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/base_cache/composer | |
key: ${{ runner.os }}-composer-${{ env.IMAGE_VERSION }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ env.IMAGE_VERSION }}- | |
${{ runner.os }}-composer- | |
- name: Cache phpcsfixer | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/base_cache/phpcsfixer | |
key: ${{ runner.os }}-phpcsfixer-${{ env.IMAGE_VERSION }}-${{ hashFiles('*/.php-cs-fixer.php') }} | |
restore-keys: | | |
${{ runner.os }}-phpcsfixer-${{ env.IMAGE_VERSION }}- | |
${{ runner.os }}-phpcsfixer- | |
- name: Prepare2 | |
run: | | |
echo "::group::Env prepare" | |
docker compose -f ./.github/docker-compose.yml up -d ${ENV_SERVICE} | |
echo "::endgroup::" | |
echo "::group::Env info" | |
docker exec ${ENV_SERVICE} php -v | |
docker exec ${ENV_SERVICE} composer -V | |
echo "::endgroup::" | |
echo "::group::Composer install" | |
docker exec ${ENV_SERVICE} composer config --global cache-files-dir /tmp/base_cache/composer | |
docker exec ${ENV_SERVICE} composer update --no-interaction --prefer-dist --no-progress | |
docker exec ${ENV_SERVICE} bash -c "cd split-repository && composer install --no-interaction --prefer-dist --no-progress" | |
echo "::endgroup::" | |
- name: Coding Standards Tests | |
run: docker exec ${ENV_SERVICE} ./vendor/bin/php-cs-fixer fix --dry-run --diff -vvv --cache-file=/tmp/base_cache/phpcsfixer/.php-cs-fixer.cache |