Merge pull request #65 from onfido/release-upgrade #127
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
# This workflow will install PHP dependencies, run tests and lint with a variety of PHP versions | |
# For more information see: https://github.com/marketplace/actions/composer-php-actions | |
# No particular step needed for publishing, package will be available on https://packagist.org just after release | |
name: PHP CI | |
on: | |
push: | |
branches: | |
- master | |
- "release/**" | |
pull_request: | |
branches: | |
- master | |
- "release/**" | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
schedule: | |
- cron: "0 15 * * 0" # Every Sunday, 3 hours after midday | |
jobs: | |
integration-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: ["8.3"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up PHP ${{ matrix.php-version }} | |
uses: php-actions/composer@v6 | |
with: | |
php_version: ${{ matrix.php-version }} | |
- name: Test with phpunit | |
if: ${{ matrix.php-version == '8.3' && | |
github.repository_owner == 'onfido' }} | |
run: | | |
vendor/bin/phpunit | |
env: | |
ONFIDO_API_TOKEN: ${{ secrets.ONFIDO_API_TOKEN }} | |
ONFIDO_SAMPLE_APPLICANT_ID: ${{ secrets.ONFIDO_SAMPLE_APPLICANT_ID }} | |
ONFIDO_SAMPLE_VIDEO_ID_1: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_1 }} | |
ONFIDO_SAMPLE_VIDEO_ID_2: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_2 }} | |
ONFIDO_SAMPLE_MOTION_ID_1: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_1 }} | |
ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }} | |
publish: | |
runs-on: ubuntu-latest | |
needs: integration-tests | |
environment: delivery | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_ACTION_ACCESS_TOKEN }} | |
ref: master | |
- name: Validate release | |
uses: onfido/onfido-actions/release-check@main | |
- name: Notify packagist.org about the new package | |
run: | | |
curl -XPOST -H'content-type:application/json' \ | |
"https://packagist.org/api/update-package?username=${PACKAGIST_API_USER}&apiToken=${PACKAGIST_API_TOKEN}" \ | |
-d'{"repository":{"url":"${{ github.server_url }}/${{ github.repository }}"}}' | |
env: | |
PACKAGIST_API_USER: ${{ secrets.PACKAGIST_API_USER }} | |
PACKAGIST_API_TOKEN: ${{ secrets.PACKAGIST_API_TOKEN }} | |
- name: Update and commit CHANGELOG.md | |
uses: onfido/onfido-actions/update-changelog@main |