From e562e8a34ad970d4588c3e39cd7eb79a3b3aaf23 Mon Sep 17 00:00:00 2001 From: Vadim Matsotskyi Date: Wed, 18 Dec 2024 19:45:52 +0200 Subject: [PATCH 1/3] - added GitHub actions PR pipeline that runs phpunit and phpcs --- .github/workflows/pr.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..4843be3 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,51 @@ +name: Image Comparator PR pipeline + +on: + push: + branches: + - github-actions + + pull_request: + types: + - assigned + - opened + - reopened + - review_requested + - synchronize + +jobs: + phpunit: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Install Composer dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Run PHPUnit tests + run: ./vendor/bin/phpunit --testsuite=unit + + phpcs: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Install Composer dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Run PHP CodeSniffer + run: ./vendor/bin/phpcs -p . From 92d554477ffbc5c8d45ac779fd1515954e545824 Mon Sep 17 00:00:00 2001 From: Vadim Matsotskyi Date: Wed, 18 Dec 2024 19:47:59 +0200 Subject: [PATCH 2/3] - trigger github actions on PR only --- .github/workflows/pr.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4843be3..1bdbfd4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,10 +1,6 @@ name: Image Comparator PR pipeline on: - push: - branches: - - github-actions - pull_request: types: - assigned From 74f8f059597866ec162eac1caa0bc85ccd6b4391 Mon Sep 17 00:00:00 2001 From: Vadim Matsotskyi Date: Fri, 20 Dec 2024 14:48:57 +0200 Subject: [PATCH 3/3] - updated ubuntu version --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1bdbfd4..d92b21b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,7 +11,7 @@ on: jobs: phpunit: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout code @@ -29,7 +29,7 @@ jobs: run: ./vendor/bin/phpunit --testsuite=unit phpcs: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout code