Skip to content

Commit

Permalink
ci: update test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
  • Loading branch information
feryardiant committed Jan 29, 2024
1 parent c905540 commit 51cf5f6
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,17 @@ jobs:
POSTGRES_DB: ${{ env.DB_DATABASE }}
POSTGRES_USER: ${{ env.DB_USERNAME }}
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
ports:
- 5432:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
ports: [5432:5432]
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }}
MYSQL_DATABASE: ${{ env.DB_DATABASE }}
MYSQL_USER: ${{ env.DB_USERNAME }}
MYSQL_PASSWORD: ${{ env.DB_PASSWORD }}
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports: [3306:3306]

strategy:
fail-fast: false
Expand Down Expand Up @@ -80,18 +74,13 @@ jobs:
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-

- name: Install dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
command: |
composer update --prefer-dist --no-interaction --no-progress
run: composer update --prefer-dist --no-interaction --no-progress

- name: Run tests
run: composer test -- --coverage

- name: Generate reports for CodeClimate
if: github.actor != 'dependabot[bot]'
if: ${{ github.actor != 'dependabot[bot]' }}
env:
COVERAGE_FILE: tests/reports/clover.xml
CODECLIMATE_REPORT: ${{ github.workspace }}/tests/reports/codeclimate.${{ matrix.php }}.json
Expand All @@ -101,14 +90,14 @@ jobs:
- name: Upload tests reports
uses: actions/upload-artifact@v4
if: github.actor != 'dependabot[bot]'
if: ${{ github.actor != 'dependabot[bot]' }}
with:
name: test-reports-${{ matrix.php }}-${{ matrix.db }}
path: tests/reports

reports:
name: Report Test Coverages
if: github.actor != 'dependabot[bot]'
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
needs: tests

Expand Down

0 comments on commit 51cf5f6

Please sign in to comment.