From 13e8544ac1869aca01b43fa7e94c3c17d5891c64 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 20 Jan 2024 13:02:49 +0900 Subject: [PATCH] fixup! Add GitHub action --- .github/workflows/continuous-integration.yml | 59 +++++++------------- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index eb5d8fb..62dd165 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -2,56 +2,37 @@ name: Continuous Integration on: push: + paths-ignore: + - '**.md' pull_request: workflow_dispatch: jobs: - phpunit: - name: PHPUnit + build: runs-on: ubuntu-latest - strategy: - matrix: - operating-system: - - ubuntu-latest - php-version: - - '8.1' - dependencies: - - lowest - - highest steps: - - name: Checkout - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - - name: Setup PHP ${{ matrix.php-version }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-version }} - coverage: pcov - ini-values: zend.assertions=1 + php-version: '8.3' - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + - name: Run test suite + run: composer run-script test - - name: Install lowest dependencies - if: ${{ matrix.dependencies == 'lowest' }} - run: composer update --prefer-lowest --no-interaction --no-progress --no-suggest + - name: Insert todo seed + run: | + mysql -u root -e "INSERT INTO ticket (id, title, dateCreated) VALUES ('1', 'foo', '1970-01-01 00:00:00')" ticket - - name: Install highest dependencies - if: ${{ matrix.dependencies == 'highest' }} - run: composer update --no-interaction --no-progress --no-suggest + - name: Request /ticket resource + run: | + php bin/app.php get '/ticket?id=1' - - name: Run test suite - run: ./vendor/bin/phpunit -c ./phpunit.xml.dist --coverage-clover=coverage.xml - - - name: Upload coverage report - uses: codecov/codecov-action@v2 - with: - file: ./coverage.xml + - name: Create API doc + run: | + composer doc +