Skip to content

Commit

Permalink
[3.0] 更新环境 CI (#689)
Browse files Browse the repository at this point in the history
* Update: 更新 CI docker 的使用

* Update: 按照组件重要程度调整测试顺序

* Update: 添加 php8.3 预构建

* Update: 更新 CI 弃用

* Update: 更新 CI 弃用
  • Loading branch information
NHZEX authored Apr 9, 2024
1 parent 8f54e93 commit f687b08
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/actions/ci-prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
- name: Setup Services
shell: bash
run: |
docker-compose -f ./.github/docker-compose.yml up -d ${{ inputs.env }}
docker compose -f ./.github/docker-compose.yml up -d ${{ inputs.env }}
docker exec ${{ inputs.env }} php -v
docker exec ${{ inputs.env }} php -m
docker exec ${{ inputs.env }} php --ri swoole
Expand Down
72 changes: 36 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
echo "REPOSITORY_OWNER=${REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
mkdir -p /tmp/base_cache/composer
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/composer
key: ${{ runner.os }}-composer-${{ env.IMAGE_VERSION }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand All @@ -59,6 +59,12 @@ jobs:
- name: Test
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-connection-center
- name: Test database
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-database
- name: Test swoole
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-swoole
Expand Down Expand Up @@ -104,12 +110,6 @@ jobs:
- name: Test phar
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-phar
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-connection-center
- name: Test database
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-database
- name: Test model
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-model
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
echo "REPOSITORY_OWNER=${REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
mkdir -p /tmp/base_cache/composer
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/composer
key: ${{ runner.os }}-composer-${{ env.IMAGE_VERSION }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand All @@ -156,6 +156,12 @@ jobs:
- name: Test
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-connection-center
- name: Test database
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-database
- name: Test swoole
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-swoole
Expand Down Expand Up @@ -198,12 +204,6 @@ jobs:
- name: Test pgsql
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-pgsql
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-connection-center
- name: Test database
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-database
- name: Test model
if: ${{ env.test_prepared && always() }}
run: docker exec ${ENV_SERVICE} composer test-model
Expand All @@ -228,7 +228,7 @@ jobs:
shell: bash
run: |
sudo apt update && sudo apt install -y rsync
docker-compose -f ./.github/docker-compose.yml up -d mysql postgres redis rabbitmq kafka1
docker compose -f ./.github/docker-compose.yml up -d mysql postgres redis rabbitmq kafka1
echo "127.0.0.1 kafka1" | sudo tee -a /etc/hosts
- name: Setup swoole-cli
run: .github/script/install-swoole-cli.sh ${{ matrix.swoole-cli }}
Expand All @@ -243,7 +243,7 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-swoole-cli-${{ matrix.swoole-cli }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand All @@ -270,6 +270,12 @@ jobs:
- name: Test
if: ${{ env.test_prepared && always() }}
run: composer test
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: composer test-connection-center
- name: Test database
if: ${{ env.test_prepared && always() }}
run: composer test-database
- name: Test swoole
if: ${{ env.test_prepared && always() }}
run: composer test-swoole
Expand Down Expand Up @@ -309,12 +315,6 @@ jobs:
- name: Test phar
if: ${{ env.test_prepared && always() }}
run: composer test-phar
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: composer test-connection-center
- name: Test database
if: ${{ env.test_prepared && always() }}
run: composer test-database
- name: Test model
if: ${{ env.test_prepared && always() }}
run: composer test-model
Expand Down Expand Up @@ -381,7 +381,7 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ env.php-versions }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand Down Expand Up @@ -412,6 +412,12 @@ jobs:
- name: Test
if: ${{ env.test_prepared && always() }}
run: composer test
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: composer test-connection-center
- name: Test database
if: ${{ env.test_prepared && always() }}
run: composer test-database
- name: Test swoole
if: ${{ env.test_prepared && always() }}
run: composer test-swoole
Expand Down Expand Up @@ -448,12 +454,6 @@ jobs:
- name: Test phar
if: ${{ env.test_prepared && always() }}
run: composer test-phar
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: composer test-connection-center
- name: Test database
if: ${{ env.test_prepared && always() }}
run: composer test-database
- name: Test model
if: ${{ env.test_prepared && always() }}
run: composer test-model
Expand Down Expand Up @@ -512,7 +512,7 @@ jobs:
"dir=$CacheDir" >> $env:GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand Down Expand Up @@ -544,6 +544,12 @@ jobs:
- name: Test
if: ${{ env.test_prepared && always() }}
run: composer test
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: composer test-connection-center-common
- name: Test database
if: ${{ env.test_prepared && always() }}
run: composer test-database
- name: Test fpm
if: ${{ env.test_prepared && always() }}
run: composer test-fpm
Expand All @@ -562,12 +568,6 @@ jobs:
- name: Test snowflake
if: ${{ env.test_prepared && always() }}
run: composer test-snowflake
- name: Test connection-center
if: ${{ env.test_prepared && always() }}
run: composer test-connection-center-common
- name: Test database
if: ${{ env.test_prepared && always() }}
run: composer test-database
- name: Test model
if: ${{ env.test_prepared && always() }}
run: composer test-model
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache vendor
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ env.PHP_VERSION }}-${{ env.SWOOLE_VERSION }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/daily-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
strategy:
matrix:
image:
- {tag: php8.3-swoole-5.1, version: 5.1-php8.3}
- {tag: php8.2-swoole-5.1, version: 5.1-php8.2}
- {tag: php8.1-swoole-5.1, version: 5.1-php8.1}
- {tag: php8.2-swoole-5.0, version: 5.0-php8.2}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/daily-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
ref: "3.0"
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/composer
key: ${{ runner.os }}-daily-test-3.0-composer-${{ matrix.php }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
with:
ref: "2.1"
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/composer
key: ${{ runner.os }}-daily-test-2.1-composer-${{ matrix.php }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
mkdir -p /tmp/base_cache/phpcsfixer
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/composer
key: ${{ runner.os }}-composer-${{ env.IMAGE_VERSION }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand All @@ -42,7 +42,7 @@ jobs:
${{ runner.os }}-composer-
- name: Cache phpcsfixer
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/phpcsfixer
key: ${{ runner.os }}-phpcsfixer-${{ env.IMAGE_VERSION }}-${{ hashFiles('*/.php-cs-fixer.php') }}
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Prepare2
run: |
echo "::group::Env prepare"
docker-compose -f ./.github/docker-compose.yml up -d ${ENV_SERVICE}
docker compose -f ./.github/docker-compose.yml up -d ${ENV_SERVICE}
echo "::endgroup::"
echo "::group::Env info"
docker exec ${ENV_SERVICE} php -v
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
mkdir -p /tmp/base_cache/phpstan
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/composer
key: ${{ runner.os }}-composer-${{ env.IMAGE_VERSION }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand All @@ -46,7 +46,7 @@ jobs:
${{ runner.os }}-composer-
- name: Cache phpstan
uses: actions/cache@v3
uses: actions/cache@v4
if: ${{ false }}
with:
path: /tmp/base_cache/phpstan
Expand All @@ -61,7 +61,7 @@ jobs:
- name: Prepare2
run: |
echo "::group::Env prepare"
docker-compose -f ./.github/docker-compose.yml up -d ${ENV_SERVICE}
docker compose -f ./.github/docker-compose.yml up -d ${ENV_SERVICE}
echo "::endgroup::"
echo "::group::Env info"
docker exec ${ENV_SERVICE} php -v
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
mkdir -p /tmp/base_cache/rector
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/composer
key: ${{ runner.os }}-composer-${{ env.IMAGE_VERSION }}-${{ hashFiles('*/composer.json', 'src/Components/*/composer.json') }}
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Prepare2
run: |
echo "::group::Env prepare"
docker-compose -f ./.github/docker-compose.yml up -d ${ENV_SERVICE}
docker compose -f ./.github/docker-compose.yml up -d ${ENV_SERVICE}
echo "::endgroup::"
echo "::group::Env info"
docker exec ${ENV_SERVICE} php -v
Expand All @@ -61,7 +61,7 @@ jobs:
echo "test_prepared=1" >> $GITHUB_ENV
- name: Cache Rector
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/base_cache/rector
key: ${{ runner.os }}-rector-${{ env.IMAGE_VERSION }}-${{ github.run_id }}
Expand Down

0 comments on commit f687b08

Please sign in to comment.