Repository navigation
64 lines (61 loc) · 2.19 KB
/
Copy pathtest-php.yml
File metadata and controls
64 lines (61 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Test PHP
on:
workflow_call:
inputs:
test-group:
required: true
type: string
env:
SPEAKEASY_DEBUG: "true"
jobs:
test-php:
timeout-minutes: 15
name: Test PHP - ${{ inputs.test-group }}
runs-on: ubicloud-standard-4-ubuntu-2404
permissions:
contents: "read"
actions: "read"
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
cmd/**/go.sum
services/**/go.sum
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
with:
php-version: "8.3"
extensions: mbstring, xml, curl
env:
update: true
COMPOSER_PROCESS_TIMEOUT: 300
- name: Configure Composer
run: composer config --global preferred-install auto
- name: Get Composer cache dir
id: composer-cache
run: echo "dir=$(composer config --global cache-dir)" >> "$GITHUB_OUTPUT"
- name: Cache Composer packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-php-dist-v3-${{ runner.os }}-${{ hashFiles('templates/templates/php/**/composer.json.stmpl') }}
- name: Test
env:
SPEAKEASY_GENERATED_LICENSE: agpl-3.0-only
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ github.token }}"}}'
run: TARGET=${{ inputs.test-group }} make test-php
- name: git diff
run: ./scripts/check-generated-diff.sh
- name: Upload test report
if: inputs.test-group != 'review'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sdk-php-${{ inputs.test-group }}-test-report
path: ./testSDKs/sdk-php-${{ inputs.test-group }}/test-php-record.txt
if-no-files-found: error