Update Python SDK #1062
Workflow file for this run
This file contains hidden or 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
| name: Test PHP SDK | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-php: | |
| name: test php sdk | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.3' | |
| extensions: json, curl, simplexml, spl, pcre | |
| coverage: xdebug | |
| - name: Validate composer.json and composer.lock | |
| working-directory: ./php/sdk | |
| run: composer validate --strict | |
| - name: Install dependencies | |
| working-directory: ./php/sdk | |
| run: composer install --prefer-dist --no-progress | |
| - name: Create .env file to test SP-API endpoints | |
| working-directory: ./php | |
| run: | | |
| echo "SP_API_CLIENT_ID=${{ secrets.SP_API_CLIENT_ID }}" >> .env | |
| echo "SP_API_CLIENT_SECRET=${{ secrets.SP_API_CLIENT_SECRET }}" >> .env | |
| echo "SP_API_REFRESH_TOKEN=${{ secrets.SP_API_REFRESH_TOKEN }}" >> .env | |
| echo "SP_API_ENDPOINT=https://api.amazon.com/auth/o2/token" >> .env | |
| echo "SP_API_ENDPOINT_HOST=https://sandbox.sellingpartnerapi-fe.amazon.com" >> .env | |
| echo "SP_API_MARKETPLACE=A1VC38T7YXB528" >> .env | |
| echo "VENDOR_API_CLIENT_ID=${{ secrets.VENDOR_API_CLIENT_ID }}" >> .env | |
| echo "VENDOR_API_CLIENT_SECRET=${{ secrets.VENDOR_API_CLIENT_SECRET }}" >> .env | |
| echo "VENDOR_API_REFRESH_TOKEN=${{ secrets.VENDOR_API_REFRESH_TOKEN }}" >> .env | |
| echo "VENDOR_API_ENDPOINT=https://api.amazon.com/auth/o2/token" >> .env | |
| echo "VENDOR_API_ENDPOINT_HOST=https://sandbox.sellingpartnerapi-na.amazon.com" >> .env | |
| echo "VENDOR_API_MARKETPLACE=A2Q3Y263D00KWC" >> .env | |
| - name: Test with PHPUnit and cleanup | |
| working-directory: ./php/sdk | |
| run: | | |
| mkdir -p build/reports | |
| if ! vendor/bin/phpunit test/Api --testdox --log-junit build/reports/junit.xml; then | |
| echo "Tests failed" | |
| exit 1 | |
| fi | |
| - name: Archive reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: php-test-reports | |
| path: php/sdk/build/reports |