-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix CI jobs #12
Merged
Merged
Fix CI jobs #12
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3f66990
fix linter ci job
aschepis 025f188
fix test ci step
aschepis 9153d10
add test-generate make target
aschepis ced37bb
add github ci step for testing generated code
aschepis c94998b
fix check for clean worktree
aschepis 5a1aa74
address code review comments
aschepis 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 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 |
---|---|---|
|
@@ -34,29 +34,24 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
cache: false | ||
# This step is performed because we some of the go:embed files are generated. However, we | ||
# can lint the code without having to do a full build/generate cycle. Therefore we | ||
# just make them do nothing. | ||
- name: disarm go:embed directives to enable lint | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a comment for why we're doing this |
||
continue-on-error: true # this fails if there are no go:embed directives | ||
run: | | ||
git grep -l 'go:embed' -- provider | xargs sed -i 's/go:embed/ goembed/g' | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
version: v1.55.2 | ||
working-directory: provider | ||
- name: Install pulumictl | ||
uses: jaxxstorm/[email protected] | ||
with: | ||
tag: v0.0.46 | ||
repo: pulumi/pulumictl | ||
- name: Install Pulumi CLI | ||
uses: pulumi/actions@v5 | ||
with: | ||
pulumi-version: ^3 | ||
- name: Lint Provider | ||
run: make lint_provider | ||
args: -c ../.golangci.yml | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
@@ -79,7 +74,7 @@ jobs: | |
with: | ||
pulumi-version: ^3 | ||
- name: Test Provider | ||
run: make test_provider | ||
run: make provider test_provider | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -132,7 +127,8 @@ jobs: | |
gradle-version: ${{ env.GRADLEVERSION }} | ||
- name: Build SDK | ||
run: make provider build_${{ matrix.language }} | ||
# TODO: Check worktree clean | ||
- name: Check generated code is up to date | ||
run: ./scripts/check_for_diffs.sh | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
|
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
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,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "--- :golang: go mod tidy" | ||
(cd provider && go mod tidy) | ||
|
||
echo "--- :git: Testing generate code is up to date" | ||
# Enable debugging to see commands executed, if needed | ||
# set -x | ||
|
||
# Check if there are any changes or untracked files | ||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "^^^ +++" | ||
git status --porcelain | ||
git diff | ||
echo "Check git status + diff above, there are changed or untracked files" | ||
exit 1 | ||
fi |
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.
any context on why this didn't work?
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 does work and we use it for some other jobs, but for linting we don't need to check out the history. we just need the commit. this is also related to why we disarm the
go:embed
stuff. We can just lint the code without having to build the provider and generate code, etc.