Skip to content
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

Makefile performance improvements #1151

Merged
merged 29 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2aa6862
Introduce .make directory for sentinel targets
danielrbradley Nov 19, 2024
fb35593
Add file target for tfgen_build_only
danielrbradley Nov 19, 2024
90bf9ad
Add sentinel target for upstream
danielrbradley Nov 20, 2024
5106e64
Add sentinel target for install_plugins
danielrbradley Nov 20, 2024
2232dcc
Add sentinel target for schema
danielrbradley Nov 20, 2024
59e380d
Fix the pulumi version being up-to-date
danielrbradley Nov 20, 2024
43a8b85
Ensure all local directories exist before evaluating targets
danielrbradley Nov 20, 2024
11c6e31
Clean bin and .make directory contents
danielrbradley Nov 21, 2024
4a7fc88
Add sentinel target for docs
danielrbradley Nov 21, 2024
cc68d9a
Remove broken help target
danielrbradley Nov 21, 2024
b79852f
Add sentinel target for build_registry_docs
danielrbradley Nov 21, 2024
912f23e
Add file target for provider target
danielrbradley Nov 22, 2024
16970ce
Add sentinel targets for generate_dotnet and build_dotnet
danielrbradley Nov 22, 2024
5ca109d
Add sentinel targets for generate_go and build_go
danielrbradley Nov 22, 2024
df87139
Add sentinel targets for generate_nodejs and build_nodejs
danielrbradley Nov 22, 2024
f113037
Add sentinel targets for generate_python and build_python
danielrbradley Nov 22, 2024
a535867
Add sentinel targets for generate_java and build_java
danielrbradley Nov 22, 2024
0546735
Tidy up top-level phony build targets
danielrbradley Nov 22, 2024
9447f73
Add sentinel targets for install_*_sdk targets
danielrbradley Nov 22, 2024
eb48e37
Tidy up remaining phony targets
danielrbradley Nov 22, 2024
f673197
Move phony statements to end of blocks
danielrbradley Nov 22, 2024
915884a
Add new `make generate` alias
danielrbradley Nov 22, 2024
13fbe34
Mark SDK as up-to-date after downloading, before testing
danielrbradley Nov 22, 2024
84396bb
Handle nuget setup in makefile
danielrbradley Nov 22, 2024
8356fca
Fix migration name
danielrbradley Nov 22, 2024
7c90873
Move build_registry_docs dependency
danielrbradley Nov 25, 2024
51dc4a1
Add `make prepare_local_workspace` target
danielrbradley Nov 25, 2024
5edada0
Moderize targets in CI
danielrbradley Nov 25, 2024
a0a2126
Add useful help text
danielrbradley Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions provider-ci/internal/pkg/migrations/ignoreMakeDir.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package migrations

import (
_ "embed"
"fmt"
"os"
"path/filepath"
"strings"
)

type ignoreMakeDir struct{}

func (ignoreMakeDir) Name() string {
return "Fixup Bridge Imports"
danielrbradley marked this conversation as resolved.
Show resolved Hide resolved
}
func (ignoreMakeDir) ShouldRun(templateName string) bool {
return templateName == "bridged-provider"
}
func (ignoreMakeDir) Migrate(templateName, outDir string) error {
gitignorePath := filepath.Join(outDir, ".gitignore")
gitignore, err := os.ReadFile(gitignorePath)
if err != nil {
if !os.IsNotExist(err) {
return fmt.Errorf("error reading .gitignore: %w", err)
}
gitignore = []byte{}
}
gitignoreString := string(gitignore)
if !strings.Contains(gitignoreString, ".make") {
gitignoreString += "\n\n# Ignore local build tracking directory\n.make\n"
err := os.WriteFile(gitignorePath, []byte(gitignoreString), 0644)
if err != nil {
return fmt.Errorf("error writing to .gitignore: %w", err)
}
return err
}
return nil
}
1 change: 1 addition & 0 deletions provider-ci/internal/pkg/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func Migrate(templateName, outDir string) error {
migrations := []Migration{
fixupBridgeImports{},
removeExplicitSDKDependency{},
ignoreMakeDir{},
}
for i, migration := range migrations {
if !migration.ShouldRun(templateName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,12 @@ jobs:
tools: pulumictl, pulumicli, ${{ matrix.language }}
- name: Download bin
uses: ./.github/actions/download-bin
- name: Add NuGet source
if: matrix.language == 'dotnet'
run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Download SDK
uses: ./.github/actions/download-sdk
with:
language: ${{ matrix.language }}
- name: Mark SDK up to date
run: make --touch build_${{ matrix.language }}
- name: Update path
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Install Python deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ jobs:
tools: pulumictl, pulumicli, ${{ matrix.language}}
- name: Download bin
uses: ./.github/actions/download-bin
- name: Add NuGet source
if: matrix.language == 'dotnet'
run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Download SDK
uses: ./.github/actions/download-sdk
with:
language: ${{ matrix.language }}
- name: Mark SDK up to date
run: make --touch build_${{ matrix.language }}
- name: Update path
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Install Python deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,12 @@ jobs:
tools: pulumictl, pulumicli, #{{ range $index, $element := .Config.Languages }}##{{if $index}}#, #{{end}}##{{ $element }}##{{end}}#
- name: Download bin
uses: ./.github/actions/download-bin
- name: Add NuGet source
if: matrix.language == 'dotnet'
run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Download SDK
uses: ./.github/actions/download-sdk
with:
language: ${{ matrix.language }}
- name: Mark SDK up to date
run: make --touch build_${{ matrix.language }}
- name: Update path
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Install Python deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,12 @@ jobs:
tools: pulumictl, pulumicli, ${{ matrix.language }}
- name: Download bin
uses: ./.github/actions/download-bin
- name: Add NuGet source
if: matrix.language == 'dotnet'
run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Download SDK
uses: ./.github/actions/download-sdk
with:
language: ${{ matrix.language }}
- name: Mark SDK up to date
run: make --touch build_${{ matrix.language }}
- name: Update path
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Install Python deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,12 @@ jobs:
tools: pulumictl, pulumicli, ${{ matrix.language }}
- name: Download bin
uses: ./.github/actions/download-bin
- name: Add NuGet source
if: matrix.language == 'dotnet'
run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Download SDK
uses: ./.github/actions/download-sdk
with:
language: ${{ matrix.language }}
- name: Mark SDK up to date
run: make --touch build_${{ matrix.language }}
- name: Update path
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Install Python deps
Expand Down
Loading
Loading