Skip to content

Commit

Permalink
Change Code Owners So Core Enablement can start reviewing the changes (
Browse files Browse the repository at this point in the history
…#2)

* add codeowner for entire codebase to core-enablement

* update makefile

* initial patch for running tests in pipeline

* troubleshooting

* more troubleshooting b/c local cannot replicate

* no null checks

* revert test changes and update github workflow doc

* revert changes for pipeline, missed env var earlier

* update generate workflow to pull apie key from secrets

* better naming convention :)

* attempt pulling in shippo token from secrets

* next attempt

* try again

* updates to correct yaml on generate and permissions on validate

* clean up workflow docs, should extract duplicate effort eventually

* spacing for readability

* piece apart workflow

* encapsulate in steps

* grrr

* this should be working

* another attempt

* revert

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* extract work to test

* attempt output but will remove b/c not safe

* revert

* comment out speakeasy portion

* attempt speakeasy generate portion now

* remove retrieve action and update generation

* restructure again

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* Update sdk_generation.yaml

* update again

* change to github_output

* reset generation workflow and update secret name from GH secrets
  • Loading branch information
rkeur7 authored Oct 30, 2024
1 parent 09a1839 commit 1990ce7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @goshippo/core-enablement
2 changes: 1 addition & 1 deletion .github/workflows/sdk_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
28 changes: 25 additions & 3 deletions .github/workflows/sdk_validation.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Validate
permissions:
contents: write
id-token: write

on:
workflow_call:
Expand All @@ -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/[email protected]
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 }}
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
LOCAL_SPEC_FILE=./build/public-api.yaml
BUILD_DIR=./build/
LOCAL_SPEC_FILE=${BUILD_DIR}public-api.yaml

check: test

Expand All @@ -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 \
Expand Down
16 changes: 6 additions & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap = "tests/bootstrap.php"
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false">
<phpunit bootstrap="tests/bootstrap.php"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnFailure="false">

<testsuites>
<testsuite name="Project Test Suite">
Expand All @@ -28,3 +23,4 @@
</php>

</phpunit>

0 comments on commit 1990ce7

Please sign in to comment.