Skip to content

Commit 1c0ef11

Browse files
authored
Merge pull request #370 from XeroAPI/PETOSS-530-Create-GitHub-actions-for-validating-PR-in-PHP-SDK-repo
PETOSS-530 - Create Github Workflow for PHP SDK to Build and Lint
2 parents 16e60e1 + 34631c5 commit 1c0ef11

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Diff for: .github/workflows/build-lint-test.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: PHP Build, Lint
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build-test-lint:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout xero-php repo
12+
uses: actions/checkout@v4
13+
with:
14+
repository: XeroAPI/xero-php-oauth2
15+
path: xero-php-oauth2
16+
17+
- name: Setup PHP
18+
run: sudo apt-get install -y php php-mbstring php-intl php-xml php-zip php-curl
19+
20+
- name: Install Composer
21+
run: |
22+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
23+
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
24+
php -r "unlink('composer-setup.php');"
25+
26+
- name: Install Dependencies
27+
run: composer install
28+
working-directory: xero-php-oauth2
29+
30+
- name: Validate PHP Syntax
31+
run: find . -path ./vendor -prune -o -name "*.php" -exec php -l {} \; > /dev/null || exit 1
32+
working-directory: xero-php-oauth2

0 commit comments

Comments
 (0)