Skip to content

ci: add e2e test to on-pr workflow #230

ci: add e2e test to on-pr workflow

ci: add e2e test to on-pr workflow #230

Workflow file for this run

name: Lint, Format, and Test
on:
workflow_call:
workflow_dispatch:
pull_request:
env:
API_KEY: ${{ secrets.API_KEY }}
APP_ID: ${{ secrets.APP_ID }}
EXAMPLE_AUTH_TOKEN: ${{ secrets.EXAMPLE_AUTH_TOKEN }}
EXAMPLE_USER_ID: ${{ secrets.EXAMPLE_USER_ID }}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phpcs, cs2pr
- name: Lint
run: phpcs -q --standard=PSR12 --report=checkstyle --ignore=src/generated/* src | cs2pr
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: php-cs-fixer, cs2pr
- name: Format
run: php-cs-fixer fix --dry-run --allow-risky=yes --format=checkstyle --rules=@PSR12 | cs2pr
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Install dependencies
run: composer install
- name: Test
run: ./vendor/bin/phpunit tests/
test-e2e:
name: Test E2E
runs-on: ubuntu-latest
steps:
- uses: actions-cool/check-user-permission@v2
with:
require: write
id: check_permission
- name: Trigger E2E Workflow in backend-sdk-tests and Wait
if: ${{ steps.check_permission.outputs.require-result == 'true' }}
uses: convictional/[email protected]
with:
owner: passageidentity
repo: backend-sdk-tests
workflow_file_name: integration-tests-complete.yml
github_token: ${{ secrets.BE_SDK_PAT }}
# github.head_ref is only available on PR events, while github.ref_name provides the branch name on other events
client_payload: >-
{
"target_sdk":"php",
"use_test_release":true,
"sdk_branch_ref":"${{ github.head_ref || github.ref_name }}"
}