-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(github): missing or build step present where is should not have b…
…een present or missing and avoid nodejs static configuration without any main Signed-off-by: kilianpaquier <[email protected]>
- Loading branch information
1 parent
21a822b
commit 6c7c547
Showing
22 changed files
with
207 additions
and
175 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
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 |
---|---|---|
|
@@ -418,7 +418,7 @@ func TestExec_Golang(t *testing.T) { | |
CI: &craft.CI{Name: tc}, | ||
Docker: &craft.Docker{Port: helpers.ToPtr(uint16(5000)), Registry: helpers.ToPtr("example.com")}, | ||
License: helpers.ToPtr("mit"), | ||
NoGoreleaser: true, | ||
NoGoreleaser: false, | ||
Platform: tc, | ||
}, | ||
Crons: map[string]struct{}{"cron-name": {}}, | ||
|
@@ -695,7 +695,7 @@ func TestExec_Nodejs(t *testing.T) { | |
Platform: tc.CI, | ||
}, | ||
Languages: map[string]any{ | ||
"nodejs": generate.PackageJSON{PackageManager: "[email protected]"}, | ||
"nodejs": generate.PackageJSON{Main: helpers.ToPtr("index.js"), PackageManager: "[email protected]"}, | ||
}, | ||
}) | ||
destdir := t.TempDir() | ||
|
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 |
---|---|---|
|
@@ -44,7 +44,7 @@ func TestDetectNodejs(t *testing.T) { | |
assert.Empty(t, exec) | ||
}) | ||
|
||
t.Run("error_validation_packagejson", func(t *testing.T) { | ||
t.Run("error_validation_packageManager", func(t *testing.T) { | ||
// Arrange | ||
destdir := t.TempDir() | ||
|
||
|
@@ -56,7 +56,30 @@ func TestDetectNodejs(t *testing.T) { | |
exec, err := generate.DetectNodejs(ctx, destdir, &generate.Metadata{}) | ||
|
||
// Assert | ||
assert.ErrorContains(t, err, "read package.json") | ||
assert.ErrorIs(t, err, generate.ErrMissingPackageManager) | ||
assert.Empty(t, exec) | ||
}) | ||
|
||
t.Run("error_invalid_static_option", func(t *testing.T) { | ||
// Arrange | ||
destdir := t.TempDir() | ||
|
||
packagejson := filepath.Join(destdir, craft.PackageJSON) | ||
err := os.WriteFile(packagejson, []byte(`{ "name": "craft", "packageManager": "[email protected]", "private": true }`), cfs.RwRR) | ||
require.NoError(t, err) | ||
|
||
config := generate.Metadata{ | ||
Configuration: craft.Configuration{ | ||
CI: &craft.CI{Static: &craft.Static{}}, | ||
}, | ||
Languages: map[string]any{}, | ||
} | ||
|
||
// Act | ||
exec, err := generate.DetectNodejs(ctx, destdir, &config) | ||
|
||
// Assert | ||
assert.ErrorIs(t, err, generate.ErrInvalidStaticDeployment) | ||
assert.Empty(t, exec) | ||
}) | ||
|
||
|
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 |
---|---|---|
|
@@ -42,6 +42,8 @@ jobs: | |
node: | ||
name: Node | ||
uses: ./.github/workflows/nodejs.yml | ||
with: | ||
build: true | ||
<<- end >> | ||
|
||
netlify: | ||
|
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 |
---|---|---|
|
@@ -33,6 +33,8 @@ jobs: | |
node: | ||
name: Node | ||
uses: ./.github/workflows/nodejs.yml | ||
with: | ||
build: true | ||
<<- end >> | ||
|
||
pages: | ||
|
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
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
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,51 @@ | ||
# Code generated by craft; DO NOT EDIT. | ||
|
||
version: 2 | ||
|
||
builds: | ||
- main: cmd/cli-name/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -X example.com/kilianpaquier/craft/internal/cobra.version={{ .Env.VERSION }} | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
announce: | ||
skip: true | ||
|
||
changelog: | ||
disable: true | ||
|
||
archives: | ||
- format: tar.gz | ||
wrap_in_directory: false | ||
name_template: >- | ||
{{- .ProjectName }}_ | ||
{{- .Os }}_ | ||
{{- .Arch }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
checksum: | ||
name_template: checksums.txt | ||
|
||
nfpms: | ||
- maintainer: maintainer name | ||
license: MIT | ||
file_name_template: >- | ||
{{- .ProjectName }}_ | ||
{{- .Os }}_ | ||
{{- .Arch }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
formats: | ||
- apk | ||
- deb | ||
- rpm |
Oops, something went wrong.