Skip to content

Commit

Permalink
ci: add build_context build to apps modules
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Feb 15, 2024
1 parent 7057d38 commit cba8b22
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-code-and-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
case "$LABEL" in
dashboard|consent|pay|admin-panel|map)
ARGS+=" //apps/$LABEL:test"
BUILD_ARGS+=" //apps/$LABEL:node_modules"
BUILD_ARGS+=" //apps/$LABEL:eslint_build_context"
;;
core)
ARGS+=" //core/api:test"
Expand Down
109 changes: 58 additions & 51 deletions apps/admin-panel/BUCK
Original file line number Diff line number Diff line change
@@ -1,95 +1,102 @@
load(
"@toolchains//workspace-pnpm:macros.bzl",
"dev_pnpm_task_binary",
"dev_pnpm_task_test",
"build_node_modules",
"next_build",
"next_build_bin",
"eslint",
"audit",
"@toolchains//workspace-pnpm:macros.bzl",
"dev_pnpm_task_binary",
"dev_pnpm_task_test",
"build_node_modules",
"prepare_build_context",
"next_build",
"next_build_bin",
"eslint",
"audit",
)

dev_pnpm_task_binary(
name="dev",
command="dev",
name="dev",
command="dev",
)

dev_pnpm_task_binary(
name="lint-fix",
command="lint:fix",
name="lint-fix",
command="lint:fix",
)

dev_pnpm_task_binary(
name="cypress-open",
command="cypress:open",
name="cypress-open",
command="cypress:open",
)

dev_pnpm_task_binary(
name="codegen",
command="codegen",
name="codegen",
command="codegen",
)

dev_pnpm_task_test(
name="test-integration",
command="cypress:run",
name="test-integration",
command="cypress:run",
)

export_file(
name="package.json",
visibility=["PUBLIC"],
name="package.json",
visibility=["PUBLIC"],
)

build_node_modules(
name="node_modules",
name="node_modules",
)

filegroup(
name="src",
srcs=glob(
[
"app/**",
"public/**",
"components/**",
"tailwind.config.ts",
"postcss.config.js",
"next.config.js",
"tsconfig.json",
"*.ts",
"instrumentation.node.ts",
]
),
name="src",
srcs=glob(
[
"app/**",
"public/**",
"components/**",
"tailwind.config.ts",
"postcss.config.js",
"next.config.js",
"tsconfig.json",
"*.ts",
"instrumentation.node.ts",
]
),
)

next_build(
name="build",
srcs=[":src"],
name="build",
srcs=[":src"],
)

next_build_bin(
name="admin-panel",
name="admin-panel",
)

dev_deps_srcs = {
"lib/eslint-config": "//lib/eslint-config:src",
"lib/eslint-config": "//lib/eslint-config:src",
}

audit(
name="audit",
level="critical",
name="audit",
level="critical",
)

prepare_build_context(
name = "eslint_build_context",
srcs = [":src"] + glob([".eslint*"]),
dev_deps_srcs = dev_deps_srcs,
)

eslint(
name="lint",
srcs=[":src"] + glob([".eslint*"]),
extensions=[".ts", ".tsx"],
allow_warnings=True,
dev_deps_srcs=dev_deps_srcs,
name="lint",
srcs=[":src"] + glob([".eslint*"]),
extensions=[".ts", ".tsx"],
allow_warnings=True,
dev_deps_srcs=dev_deps_srcs,
)

test_suite(
name="test",
tests=[
":audit",
":lint",
],
name="test",
tests=[
":audit",
":lint",
],
)
24 changes: 16 additions & 8 deletions apps/consent/BUCK
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
load("@toolchains//workspace-pnpm:macros.bzl",
"dev_pnpm_task_binary",
"dev_pnpm_task_test",
"build_node_modules",
"next_build",
"next_build_bin",
"eslint",
"audit",
load(
"@toolchains//workspace-pnpm:macros.bzl",
"dev_pnpm_task_binary",
"dev_pnpm_task_test",
"build_node_modules",
"prepare_build_context",
"next_build",
"next_build_bin",
"eslint",
"audit",
)

dev_pnpm_task_binary(
Expand Down Expand Up @@ -82,6 +84,12 @@ audit(
level = "critical",
)

prepare_build_context(
name = "eslint_build_context",
srcs = [":src"] + glob([".eslint*"]),
dev_deps_srcs = dev_deps_srcs,
)

eslint(
name = "lint",
srcs = [":src"] + glob([".eslint*"]),
Expand Down
7 changes: 7 additions & 0 deletions apps/dashboard/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load(
"dev_pnpm_task_binary",
"dev_pnpm_task_test",
"build_node_modules",
"prepare_build_context",
"next_build",
"next_build_bin",
"eslint",
Expand Down Expand Up @@ -77,6 +78,12 @@ audit(
level = "critical",
)

prepare_build_context(
name = "eslint_build_context",
srcs = [":src"] + glob([".eslint*"]),
dev_deps_srcs = dev_deps_srcs,
)

eslint(
name = "lint",
srcs = [":src"] + glob([".eslint*"]),
Expand Down
7 changes: 7 additions & 0 deletions apps/map/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load(
"dev_pnpm_task_binary",
"dev_pnpm_task_test",
"build_node_modules",
"prepare_build_context",
"next_build",
"next_build_bin",
"eslint",
Expand Down Expand Up @@ -68,6 +69,12 @@ audit(
level = "critical",
)

prepare_build_context(
name = "eslint_build_context",
srcs = [":src"] + glob([".eslint*"]),
dev_deps_srcs = dev_deps_srcs,
)

eslint(
name = "lint",
srcs = [":src"] + glob([".eslint*"]),
Expand Down
7 changes: 7 additions & 0 deletions apps/pay/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load(
"dev_pnpm_task_binary",
"dev_pnpm_task_test",
"build_node_modules",
"prepare_build_context",
"next_build",
"next_build_bin",
"eslint",
Expand Down Expand Up @@ -95,6 +96,12 @@ audit(
level = "critical",
)

prepare_build_context(
name = "eslint_build_context",
srcs = [":src"] + glob([".eslint*"]),
dev_deps_srcs = dev_deps_srcs,
)

eslint(
name = "lint",
srcs = [":src"] + glob([".eslint*"]),
Expand Down

0 comments on commit cba8b22

Please sign in to comment.