generated from roots/acorn-example-package
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
974c6c2
commit cb535e6
Showing
1 changed file
with
3 additions
and
64 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,72 +5,11 @@ on: | |
types: [published] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
badges: | ||
name: Create badges | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: '8.1' | ||
extensions: simplexml, dom, xml, xdebug, intl | ||
tools: composer:v2 | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.YARD_BOT_PAT }} | ||
|
||
- 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@v4 | ||
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 Unit Tests | ||
run: XDEBUG_MODE_COVERAGE=coverage vendor/bin/pest --coverage-clover=clover.xml | ||
|
||
- name: Make lines of code badge | ||
uses: DeathSy/[email protected] | ||
id: badge | ||
with: | ||
debug: true | ||
directory: ./src | ||
patterns: '**/*.php' | ||
badge: ./output/lines-of-code.svg | ||
|
||
- name: Make code coverage badge | ||
uses: timkrase/[email protected] | ||
with: | ||
coverage_badge_path: output/coverage.svg | ||
push_badge: false | ||
|
||
- name: Git push to badges branch | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
publish_dir: ./output | ||
publish_branch: badges | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
user_name: 'github-actions[bot]' | ||
user_email: 'github-actions[bot]@users.noreply.github.com' | ||
composer-diff: | ||
uses: yardinternet/workflows/.github/workflows/badges.yml@main | ||
secrets: inherit |