diff --git a/.github/workflows/check-code-and-unit-test.yaml b/.github/workflows/check-code-and-unit-test.yaml index 428cb3a4797..405934fef4f 100644 --- a/.github/workflows/check-code-and-unit-test.yaml +++ b/.github/workflows/check-code-and-unit-test.yaml @@ -45,6 +45,11 @@ jobs: ;; core) ARGS+=" //core/api:test" + BUILD_ARGS+=" //core/api:eslint_build_context" + BUILD_ARGS+=" //core/api:tsc_check_build_context" + BUILD_ARGS+=" //core/api:yaml_build_context" + BUILD_ARGS+=" //core/api:madge_build_context" + BUILD_ARGS+=" //core/api:jest_build_context" BUILD_ARGS+=" //core/api:prod_build" ;; api-keys|notifications) diff --git a/core/api/BUCK b/core/api/BUCK index 1159d5263f3..a2d3b76dc65 100644 --- a/core/api/BUCK +++ b/core/api/BUCK @@ -70,6 +70,12 @@ prod_deps_srcs = { "lib/gt3-server-node-express-sdk": "//lib/gt3-server-node-express-sdk:src", } +prepare_build_context( + name = "tsc_build_context", + srcs = [":src"], + prod_deps_srcs = prod_deps_srcs, +) + tsc_build( name = "build", tsconfig = "tsconfig-build.json", @@ -132,17 +138,16 @@ dev_update_file( out = "src/graphql/admin/schema.graphql" ) -prepare_build_context( - name = "checks_build_context", - srcs = [":src"] + [":test_src"], - prod_deps_srcs = prod_deps_srcs, -) - audit( name = "audit", level = "critical", ) +prepare_build_context( + name = "eslint_build_context", + srcs = [":src"] + [":test_src"] + glob([".eslint*"]), +) + eslint( name = "check-lint", srcs = [":src"] + [":test_src"] + glob([".eslint*"]), @@ -155,6 +160,11 @@ dev_pnpm_task_test( command = "eslint-check", ) +prepare_build_context( + name = "tsc_check_build_context", + srcs = [":src"] + [":test_src"], +) + typescript_check( name = "check-type", srcs = [":src"] + [":test_src"], @@ -165,6 +175,16 @@ dev_pnpm_task_test( command = "tsc-check", ) +prepare_build_context( + name = "yaml_build_context", + srcs = glob([ + ".prettier*", + "prettier*", + "*.yml", + "*.yaml", + ]), +) + yaml_check( name = "check-yaml", srcs = glob([ @@ -175,6 +195,11 @@ yaml_check( ]), ) +prepare_build_context( + name = "madge_build_context", + srcs = [":src"], +) + madge_check( name = "check-circular-dependencies", srcs = [":src"], @@ -185,6 +210,12 @@ dev_pnpm_task_test( command = "circular-deps-check", ) +prepare_build_context( + name = "jest_build_context", + srcs = [":src"] + [":test_src"] + glob([".env", "galoy.yaml"]), + prod_deps_srcs = prod_deps_srcs, +) + jest_test( name = "unit-tests", srcs = [":src"] + [":test_src"] + glob([".env", "galoy.yaml"]), diff --git a/toolchains/workspace-pnpm/macros.bzl b/toolchains/workspace-pnpm/macros.bzl index f31406c1287..e086d610b8a 100644 --- a/toolchains/workspace-pnpm/macros.bzl +++ b/toolchains/workspace-pnpm/macros.bzl @@ -957,7 +957,7 @@ def typescript_check( node_modules = ":node_modules", visibility = ["PUBLIC"], **kwargs): - build_context = "typescript_build_context" + build_context = "tsc_check_build_context" if not rule_exists(build_context): prepare_build_context( name = build_context,