Bump actions/checkout from 3 to 4 #726
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
# When a PR is opened or a push is made, perform an | |
# architectural inspection on the code using Deptrac. | |
name: Deptrac | |
on: | |
pull_request: | |
branches: | |
- 'develop' | |
paths: | |
- '**.php' | |
- 'composer.*' | |
- 'depfile.yaml' | |
- '.github/workflows/inspect.yml' | |
push: | |
branches: | |
- 'develop' | |
paths: | |
- '**.php' | |
- 'composer.*' | |
- 'depfile.yaml' | |
- '.github/workflows/inspect.yml' | |
jobs: | |
build: | |
name: Dependency Tracing | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
tools: composer | |
extensions: intl, json, mbstring, xml | |
coverage: none | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get composer cache directory | |
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.COMPOSER_CACHE_FILES_DIR }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Create Deptrac cache directory | |
run: mkdir -p build/ | |
- name: Cache Deptrac results | |
uses: actions/cache@v3 | |
with: | |
path: build | |
key: ${{ runner.os }}-deptrac-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-deptrac- | |
- name: Install dependencies (limited) | |
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} | |
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader | |
- name: Install dependencies (authenticated) | |
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} | |
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader | |
env: | |
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} | |
- name: Trace dependencies | |
run: | | |
composer require --dev qossmic/deptrac-shim | |
vendor/bin/deptrac analyze --cache-file=build/deptrac.cach | |
env: | |
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |