github 自带的 actions 是很好的 CI/CD 工具
正好最近写个composer包练手 用 actions 来做下自动化测试
https://docs.github.com/cn/actions/quickstart
官方文档

name: Test

on: [push]

jobs:
    test:
        name: Test

        runs-on: ubuntu-latest

        strategy:
            matrix:
                php-version: ['7.3', '7.4', '8.0']

        steps:
            - name: Setup PHP ${{ matrix.php-version }}
              uses: shivammathur/setup-php@v2
              with:
                  php-version: ${{ matrix.php-version }}

            - name: Checkout
              uses: actions/checkout@v2

            - name: Validate composer.json and composer.lock
              run: composer validate

            - name: Install dependencies
              run: composer install

            - name: Run test suite
              run: composer run-script test

QQ图片20220209185202.png

最后修改:2022 年 02 月 09 日 06 : 53 PM
如果觉得我的文章对你有用,请随意赞赏