From b9fbc7df5e24b1e15347362ca9400c102288f123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Thu, 26 Dec 2024 08:13:31 +0000 Subject: [PATCH 1/3] Improve CI --- .github/workflows/integrate.yml | 114 ++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/workflows/integrate.yml diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml new file mode 100644 index 0000000..08d8fa4 --- /dev/null +++ b/.github/workflows/integrate.yml @@ -0,0 +1,114 @@ +name: integrate + +on: + workflow_dispatch: + pull_request: + branches: + - main + paths: + - ".github/workflows/php.yml" + - "**.php" + - "composer.json" + - "composer.lock" + - "phpcs.xml.dist" + - "phpstan.neon.dist" + - "phpunit.xml.dist" + push: + branches: + - main + paths: + - ".github/workflows/php.yml" + - "**.php" + - "composer.json" + - "composer.lock" + - "phpcs.xml.dist" + - "phpstan.neon.dist" + - "phpunit.xml.dist" + +jobs: + unit_tests: + strategy: + fail-fast: true + matrix: + php-version: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] + dependencies: [lowest, highest] + os: [windows-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + + - name: Install dependencies + uses: ramsey/composer-install@v3 + with: + dependency-versions: ${{ matrix.dependencies }} + + - name: Run unit tests + run: vendor/bin/phpunit + if: matrix.os != 'ubuntu-latest' || matrix.php-version != '8.3' + + - name: Run unit tests with coverage + run: vendor/bin/phpunit --coverage-clover coverage.xml + if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3' + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + if: env.CODECOV_TOKEN && matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3' + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + coding_standards: + strategy: + matrix: + php-version: ["7.4"] + dependencies: [highest] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + + - name: Install dependencies + uses: ramsey/composer-install@v3 + with: + dependency-versions: ${{ matrix.dependencies }} + + - name: Run linter + run: composer run phpcs + + static_analysis: + strategy: + matrix: + php-version: ["7.4"] + dependencies: [highest] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + + - name: Install dependencies + uses: ramsey/composer-install@v3 + with: + dependency-versions: ${{ matrix.dependencies }} + + - name: Run static analysis + run: composer run phpstan From 26bb84c23a7b8fb987c676009a71c22ec2cf5c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sun, 17 Nov 2024 11:09:12 +0100 Subject: [PATCH 2/3] Fix workflow name --- .github/workflows/integrate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 08d8fa4..7f1b927 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -6,7 +6,7 @@ on: branches: - main paths: - - ".github/workflows/php.yml" + - ".github/workflows/integrate.yml" - "**.php" - "composer.json" - "composer.lock" @@ -17,7 +17,7 @@ on: branches: - main paths: - - ".github/workflows/php.yml" + - ".github/workflows/integrate.yml" - "**.php" - "composer.json" - "composer.lock" From bc4f7789bcce012099a0be910a12ab3d41620db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 24 Dec 2024 18:44:46 +0100 Subject: [PATCH 3/3] Implement 394e79b --- .github/workflows/integrate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 7f1b927..40f5613 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -58,7 +58,7 @@ jobs: if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3' - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 if: env.CODECOV_TOKEN && matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3' env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}