-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mintlify-migrator-cli
- Loading branch information
Showing
202 changed files
with
3,210 additions
and
796 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Cached Seed Generation | ||
description: Run seed generation with caching for a specific generator. | ||
|
||
inputs: | ||
generator-name: | ||
description: Generator to use (e.g., go-sdk, ruby-sdk) | ||
required: true | ||
generator-path: | ||
description: The path to the source code of the generator (e.g., generators/go, generators/ruby) | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Generate input hash | ||
id: hash | ||
shell: bash | ||
run: | | ||
HASH=$(./scripts/hash.sh \ | ||
packages/seed \ | ||
test-definitions \ | ||
packages/ir-sdk/fern/apis \ | ||
packages/cli/generation/ir-generator \ | ||
${{ inputs.generator-path }} \ | ||
seed/${{ inputs.generator-name }}/seed.yml \ | ||
--exclude versions.yml) | ||
echo "hash=${HASH}" >> $GITHUB_OUTPUT | ||
- name: Check cache | ||
id: cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: seed/${{ inputs.generator-name }} | ||
key: seed-${{ inputs.generator-name }}-${{ steps.hash.outputs.hash }} | ||
|
||
- name: Install | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: ./.github/actions/install | ||
|
||
- uses: bufbuild/[email protected] | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
with: | ||
github_token: ${{ github.token }} | ||
|
||
- uses: actions/setup-go@v5 | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
with: | ||
go-version: "stable" | ||
|
||
- name: Install protoc-gen-openapi | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: go install github.com/google/gnostic/cmd/[email protected] | ||
|
||
- name: Seed Test | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
shell: bash | ||
env: | ||
FORCE_COLOR: "2" | ||
run: | | ||
pnpm seed:local test --generator ${{ inputs.generator-name }} --parallel 16 | ||
- name: Validate results | ||
id: validate | ||
shell: bash | ||
run: | | ||
if git --no-pager diff --exit-code -- ":(exclude)seed/*/.mock/*"; then | ||
echo "Results are valid, saving to cache if not already." | ||
echo "valid=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "Changes detected in git-tracked files." | ||
exit 1 | ||
fi | ||
- name: Save cache | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: seed/${{ inputs.generator-name }} | ||
key: seed-${{ inputs.generator-name }}-${{ steps.hash.outputs.hash }} |
Oops, something went wrong.