Skip to content

Allow configuring azure graph URL #2178

Allow configuring azure graph URL

Allow configuring azure graph URL #2178

Workflow file for this run

name: Test
on:
pull_request:
push:
branches: master
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.5'
extensions: json, mbstring
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Lint the code
run: vendor/bin/parallel-lint --exclude vendor .
- name: Lint composer.json
run: composer validate --strict
detect:
runs-on: ubuntu-latest
name: Detect changed providers
outputs:
providers: ${{ steps.detect.outputs.providers }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Needs history back to the merge base to diff the branch.
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.5'
extensions: json, mbstring
- name: Detect changed providers
id: detect
env:
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
HEAD_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
run: |
# Triple-dot diffs against the merge base, so commits landed on the
# base branch since this one forked are not counted as changes.
providers=$(php tools/changed-providers.php "$BASE_SHA...$HEAD_SHA")
echo "providers=$providers" >> "$GITHUB_OUTPUT"
echo "Testing: $providers"
test:
runs-on: ubuntu-latest
needs: detect
# An empty matrix fails at expansion time, so skip the job entirely.
if: needs.detect.outputs.providers != '[]'
name: Test ${{ matrix.provider }}
strategy:
fail-fast: false
matrix:
provider: ${{ fromJSON(needs.detect.outputs.providers) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.5'
extensions: json, mbstring
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
# Most providers only need the root install, which autoloads every
# src/* class. A handful declare their own third-party dependencies -
# install those so they are tested against what users actually get.
- name: Install provider dependencies
if: matrix.provider != 'all'
env:
PROVIDER: ${{ matrix.provider }}
run: |
# Keep the version constraints, so CI resolves what a user installing
# this provider would actually get.
extra=$(jq -r '.require | to_entries[]
| select(.key | test("^(php|ext-|socialiteproviders/manager$)") | not)
| "\(.key):\(.value)"' "src/$PROVIDER/composer.json")
if [ -n "$extra" ]; then
echo "Installing provider dependencies:"
echo "$extra"
echo "$extra" | tr '\n' '\0' \
| xargs -0 composer require --no-interaction --prefer-dist --update-with-dependencies
else
echo "No extra dependencies."
fi
- name: Run tests
env:
PROVIDER: ${{ matrix.provider }}
run: |
if [ "$PROVIDER" = "all" ]; then
vendor/bin/phpunit --testsuite Providers
else
vendor/bin/phpunit --testsuite Providers --filter "SocialiteProviders\\\\Tests\\\\$PROVIDER\\\\"
fi