From e5f0aab754ad6da6e110d51c396dd559da67c0f1 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 6 Feb 2024 18:26:46 +0500 Subject: [PATCH] ci: ci plan (#8) --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ae10559 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + #test: + # name: PHP ${{ matrix.php }} ${{ matrix.composer-flags }}Unit Test + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # php: ["8.1", "8.2", "8.3"] + # composer-flags: [""] + # include: + # - php: "8.3" + # composer-flags: "--prefer-lowest " + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # + # - name: Setup PHP + # uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php }} + # + # - name: Install Dependencies + # uses: nick-invision/retry@v2 + # with: + # timeout_minutes: 10 + # max_attempts: 3 + # command: composer update ${{ matrix.composer-flags }} + # + # - name: Run Script + # run: vendor/bin/phpunit + + style: + name: PHP Style Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.1" + - name: Install Dependencies + uses: nick-invision/retry@v2 + with: + timeout_minutes: 10 + max_attempts: 3 + command: composer install + - name: Run Script + run: vendor/bin/phpcs . --standard=phpcs.xml.dist -nps + + staticanalysis: + name: PHPStan Static Analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + - name: Run Script + run: | + composer install + composer global require phpstan/phpstan + ~/.composer/vendor/bin/phpstan analyse \ No newline at end of file