Added overwrite-flag to upload-artifact Action #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build and test | |
on: [push, pull_request, workflow_dispatch] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: ['7.0', '7.4', '8.0', '8.2'] | |
max-parallel: 2 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: vendor | |
key: php-${{ matrix.version }}-${{ github.ref }} | |
- name: Setup PHP | |
id: setup-php | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.version }} | |
coverage: none | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: ['7.0', '7.4', '8.0', '8.2'] | |
max-parallel: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
id: setup-php | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.version }} | |
coverage: xdebug2 | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: vendor | |
key: php-${{ matrix.version }}-${{ github.ref }} | |
- name: Run test suite | |
run: php vendor/bin/phpunit --coverage-clover=coverage.xml --whitelist=./src ./tests | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: coverage.xml | |
overwrite: true | |
retention-days: 1 | |
coverage_upload: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download code coverage results | |
uses: actions/download-artifact@v4 | |
with: | |
name: code-coverage-report | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |