diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..efb61af --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @goshippo/core-enablement \ No newline at end of file diff --git a/.github/workflows/sdk_generation.yaml b/.github/workflows/sdk_generation.yaml index 7525d1f..f048fda 100644 --- a/.github/workflows/sdk_generation.yaml +++ b/.github/workflows/sdk_generation.yaml @@ -22,4 +22,4 @@ jobs: speakeasy_version: latest secrets: github_access_token: ${{ secrets.GITHUB_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + speakeasy_api_key: ${{ secrets.SPEAKEASY_PHP_API_KEY }} \ No newline at end of file diff --git a/.github/workflows/sdk_validation.yaml b/.github/workflows/sdk_validation.yaml index 644c996..ba7fc23 100644 --- a/.github/workflows/sdk_validation.yaml +++ b/.github/workflows/sdk_validation.yaml @@ -1,4 +1,7 @@ name: Validate +permissions: + contents: write + id-token: write on: workflow_call: @@ -9,25 +12,44 @@ jobs: check: runs-on: ubuntu-latest timeout-minutes: 10 - env: - SHIPPO_TOKEN: ${{ secrets.SHIPPO_TOKEN }} concurrency: group: php-sdk-check steps: + - name: Authenticate with AWS + uses: goshippo/shippo-action-workflows/.github/actions/aws_auth@v1.1.0 + with: + environment: dev-main + oidc-name: shippo-php-sdk-pipeline + login-to-ecr: false + + - name: Get Speakeasy Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + dev-main-speakeasy-api-key + name-transformation: uppercase + parse-json-secrets: true + - name: Check out repository uses: actions/checkout@v4 + - name: Set up PHP id: setup_php uses: shivammathur/setup-php@v2 with: php-version: '8.1' + - name: cache dependencies uses: actions/cache@v4 with: path: ./vendor key: python-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('setup.py') }} + - name: Install dependencies run: | make install + - name: Check - run: make check + run: make check + env: + SHIPPO_TOKEN: ${{ env.DEV_MAIN_SPEAKEASY_API_KEY_SHIPPO_TOKEN }} diff --git a/Makefile b/Makefile index 73fdeca..74378e7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -LOCAL_SPEC_FILE=./build/public-api.yaml +BUILD_DIR=./build/ +LOCAL_SPEC_FILE=${BUILD_DIR}public-api.yaml check: test @@ -13,7 +14,8 @@ speakeasy-install: # dev task, locally install the speakeasy CLI speakeasy auth login download-public-spec: # dev task, download the current public spec, in preparation for modifying and running speakeasy-generate - curl https://docs.goshippo.com/spec/shippoapi/public-api.yaml > $$LOCAL_SPEC_FILE + mkdir -p ${BUILD_DIR} + curl https://docs.goshippo.com/spec/shippoapi/public-api.yaml > ${LOCAL_SPEC_FILE} speakeasy-generate: # dev task, run the generator on a local spec. useful for testing out changes to the spec or gen.yaml - but DO NOT commit the results of manual generation if [ ! -f "${LOCAL_SPEC_FILE}" ]; then \ diff --git a/phpunit.xml b/phpunit.xml index 93871f7..f939353 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,15 +1,10 @@ - + @@ -28,3 +23,4 @@ +