From fb57030f8ddaa825d36e81e47e63d2121be7248e Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Sun, 20 Oct 2024 11:22:24 +0100 Subject: [PATCH] chore: remove obsolete workflow files and create a new pipeline Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- .github/workflows/pint.yml | 42 ----------------- .github/workflows/pipeline.yml | 19 ++++++++ .github/workflows/run-tests.yml | 67 --------------------------- .github/workflows/static-analysis.yml | 45 ------------------ 4 files changed, 19 insertions(+), 154 deletions(-) delete mode 100644 .github/workflows/pint.yml create mode 100644 .github/workflows/pipeline.yml delete mode 100644 .github/workflows/run-tests.yml delete mode 100644 .github/workflows/static-analysis.yml diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml deleted file mode 100644 index 0ae879c..0000000 --- a/.github/workflows/pint.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: PHP Linting (Pint) - -on: - push: - branches: - - master - - v4 - - release/* - - hotfix/* - pull_request: - branches: - - master - - v4 - - release/* - - hotfix/* - workflow_dispatch: - -jobs: - phplint: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.3 - tools: composer:v2 - coverage: none - - - name: Composer Install - run: composer install --no-interaction - - - name: Run Laravel Pint - run: composer format - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: PHP Linting (Pint) - Fix styling - skip_fetch: true diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..9490ca7 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,19 @@ +name: :package_name CI Pipeline + +on: [ push, pull_request, workflow_dispatch ] + +jobs: + php-lint: + uses: tastyigniter/workflows/.github/workflows/php-lint.yml@main + with: + composer: update --no-interaction --no-progress + php-tests: + needs: php-lint + if: ${{ always() && needs.php-lint.result == 'success' }} + strategy: + matrix: + php: [ '8.2', '8.3' ] + uses: tastyigniter/workflows/.github/workflows/php-tests.yml@main + with: + php-version: ${{ matrix.target }} + composer: update --no-interaction --no-progress diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml deleted file mode 100644 index 48c14e5..0000000 --- a/.github/workflows/run-tests.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Pest Tests - -on: - push: - branches: - - master - - v4 - - release/* - - hotfix/* - pull_request: - branches: - - master - - v4 - - release/* - - hotfix/* - workflow_dispatch: - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - php: [ 8.2, 8.3 ] - env: - DB_DATABASE: testbench - DB_USERNAME: root - DB_PASSWORD: root - - name: PHP ${{ matrix.php }} - Pest Tests - - services: - mysql: - image: 'mysql:8.0' - env: - MYSQL_ALLOW_EMPTY_PASSWORD: false - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: testbench - ports: - - 3306/tcp - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, xml, mbstring, zip, pdo, sqlite, bcmath, soap, intl, gd - coverage: none - - - name: Create MySQL Database - run: | - sudo systemctl start mysql - mysql -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' --port ${{ job.services.mysql.ports['3306'] }} - - - name: Setup problem matchers - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Install dependencies - run: composer update --prefer-stable --prefer-dist --no-interaction - - - name: Execute tests - run: composer test diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index 5258312..0000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: "Static Analysis" - -on: - push: - branches: - - master - - v4 - - release/* - - hotfix/* - pull_request: - branches: - - master - - v4 - - release/* - - hotfix/* - workflow_dispatch: - -jobs: - types: - runs-on: ubuntu-latest - strategy: - matrix: - php: [ 8.2, 8.3 ] - name: PHP ${{ matrix.php }} - Static Analysis - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, fileinfo - tools: composer:v2 - coverage: none - - - name: Install dependencies - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress - - - name: Execute static analysis - run: composer static