Skip to content

Run Tests

Run Tests #184

Workflow file for this run

name: Run Tests
env:
SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }}
TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }}
on:
push:
branches: [ "main" ]
pull_request:
workflow_dispatch:
workflow_call:
inputs:
test_data_branch:
type: string
description: The branch in sdk-test-data to target for testcase files
required: false
default: main
sdk_branch:
type: string
description: The branch of the SDK to test
required: false
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Display Testing Details
run: |
echo "Running SDK Test using"
echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}"
echo "SDK Branch: php-sdk@${SDK_BRANCH_NAME}"
- uses: actions/checkout@v3
with:
repository: Eppo-exp/php-sdk
ref: ${{ env.SDK_BRANCH_NAME}}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run tests
run: make test branchName=${{env.TEST_DATA_BRANCH_NAME}}