-
Notifications
You must be signed in to change notification settings - Fork 887
Fix generating files with docker #829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bbd1e39
Fix generating in docker
jakubno 71f8ad0
Support both x86_64 and arm
jakubno b61d9be
Run codegen
jakubno aa45b50
Improve check for missing files
jakubno 2042a57
Remove make installation
jakubno 12545c6
Pipeline improvements
jakubno c663a15
Add missing files
jakubno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Generated files | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| check-generated: | ||
| name: Generated files | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v3 | ||
| id: pnpm-install | ||
| with: | ||
| version: 9.5 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| cache: pnpm | ||
| cache-dependency-path: pnpm-lock.yaml | ||
|
|
||
| - name: Configure pnpm | ||
| run: | | ||
| pnpm config set auto-install-peers true | ||
| pnpm config set exclude-links-from-lockfile true | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build codegen image with caching | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: codegen.Dockerfile | ||
| tags: codegen-env:latest | ||
| load: true # makes the image available for `docker run` | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Run codegen | ||
| run: make codegen | ||
|
|
||
| - name: Check for uncommitted changes | ||
| run: | | ||
| if [[ -n $(git status --porcelain) ]]; then | ||
| echo "❌ Generated files are not up to date:" | ||
| git status --short | ||
| git diff | ||
| exit 1 | ||
| else | ||
| echo "✅ No changes detected." | ||
| fi |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,16 @@ | ||
| update-api-spec: | ||
| @echo "Updating API spec" | ||
| @./scripts/update-api-spec.sh | ||
| @echo "Done" | ||
|
|
||
| .PHONY: codegen | ||
| codegen: | ||
| @echo "Generating SDK code from openapi and envd spec" | ||
| @./scripts/codegen.sh | ||
|
|
||
| @docker run -v "$$(pwd):/workspace" $$(docker build -q -t codegen-env . -f codegen.Dockerfile) | ||
| generate: generate-js generate-python | ||
|
|
||
| generate-js: | ||
| cd packages/js-sdk && pnpm generate | ||
| cd packages/js-sdk && pnpm generate-envd-api | ||
| cd spec/envd && buf generate --template buf-js.gen.yaml | ||
|
|
||
| generate-python: | ||
| if [ ! -f "/go/bin/protoc-gen-connect-python" ]; then \ | ||
| $(MAKE) -C packages/connect-python build; \ | ||
| fi | ||
| cd packages/python-sdk && make generate-api | ||
| cd spec/envd && buf generate --template buf-python.gen.yaml | ||
| cd packages/python-sdk && ./scripts/fix-python-pb.sh && black . | ||
| cd packages/python-sdk && make generate | ||
|
|
||
| .PHONY: init-styles | ||
| init-styles: | ||
| vale sync | ||
|
|
||
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is the spec updated now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it didn't work and it isn't used anyway, so I removed it to prevent issues