-
-
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.
Merge pull request #1 from alexeagle/ci
ci: verify that generated project can build and test
- Loading branch information
Showing
4 changed files
with
77 additions
and
5 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,31 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '>=1.22' | ||
- uses: bazel-contrib/[email protected] | ||
with: | ||
bazelisk-cache: true | ||
repository-cache: true | ||
- run: go install github.com/hay-kot/[email protected] | ||
- name: Scaffold new kitchen-sink app | ||
id: kitchen-sink | ||
run: | | ||
scaffold new --preset=kitchen-sink --no-prompt $GITHUB_WORKSPACE | ||
cd scaffold_test* | ||
git init | ||
echo "::set-output name=dir::$PWD" | ||
- name: Test kitchen-sink | ||
working-directory: "${{ steps.kitchen-sink.outputs.dir }}" | ||
run: | | ||
bazel test ... | ||
bazel run format |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
configure: | ||
languages: | ||
javascript: false | ||
{{- range .Scaffold.langs}} | ||
{{- if eq . "JavaScript"}} | ||
javascript: true | ||
{{- end}} | ||
{{- end}} |
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 |
---|---|---|
@@ -1,7 +1,42 @@ | ||
bazel_dep(name = "aspect_bazel_lib", version = "2.7.1") | ||
bazel_dep(name = "aspect_rules_lint", version = "0.18.0") | ||
bazel_dep(name = "rules_multitool", version = "0.7.1") | ||
{{- range .Scaffold.langs}} | ||
{{- if eq . "JavaScript"}} | ||
bazel_dep(name = "aspect_rules_js", version = "1.32.6") | ||
{{- end}} | ||
{{- if eq . "TypeScript"}} | ||
bazel_dep(name = "aspect_rules_ts", version = "2.3.0") | ||
{{- end}} | ||
{{- end}} | ||
|
||
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool") | ||
multitool.hub(lockfile = "//tools:tools.lock.json") | ||
use_repo(multitool, "multitool") | ||
|
||
{{- range .Scaffold.langs}} | ||
{{- if eq . "JavaScript"}} | ||
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") | ||
# Allows developers to get a local node_modules tree, using | ||
# bazel run -- @pnpm//:pnpm --dir $PWD install | ||
use_repo(pnpm, "pnpm") | ||
|
||
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") | ||
npm.npm_translate_lock( | ||
name = "npm", | ||
npmrc = "//:.npmrc", | ||
pnpm_lock = "//:pnpm-lock.yaml", | ||
) | ||
use_repo(npm, "npm") | ||
{{- end}} | ||
|
||
{{- if eq . "TypeScript"}} | ||
rules_ts_ext = use_extension( | ||
"@aspect_rules_ts//ts:extensions.bzl", | ||
"ext", | ||
dev_dependency = True, | ||
) | ||
rules_ts_ext.deps() | ||
use_repo(rules_ts_ext, "npm_typescript") | ||
{{- end}} | ||
{{- end}} |