improvement on remove elements by class to work with any tag not just… #2
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: ci | |
on: [ push, pull_request ] | |
jobs: | |
test: | |
permissions: | |
contents: write | |
name: Run tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: [ '8.1', '8.2', '8.3' ] | |
steps: | |
- name: Checkout codebase | |
uses: actions/checkout@v4 | |
- name: Setup PHP Action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --prefer-dist | |
- name: Recreate autoload file | |
run: composer dump-autoload | |
- name: Run Psalm | |
run: ./vendor/bin/psalm | |
- name: Run Unit Tests | |
run: XDEBUG_MODE_COVERAGE=coverage vendor/bin/phpunit | |
- if: ${{ (matrix.php-versions == '8.3') }} | |
name: Generate test coverage badge | |
uses: timkrase/phpunit-coverage-badge@v1.2.1 | |
with: | |
coverage_badge_path: output/coverage.svg | |
push_badge: false | |
- if: ${{ (matrix.php-versions == '8.3') }} | |
name: Git push to image-data branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
publish_dir: ./output | |
publish_branch: image-data | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |