Skip to content

Commit

Permalink
build: add separate build runs in check gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Feb 14, 2024
1 parent 728dcec commit ca0c067
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/check-code-and-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
43 changes: 37 additions & 6 deletions core/api/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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*"]),
Expand All @@ -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"],
Expand All @@ -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([
Expand All @@ -175,6 +195,11 @@ yaml_check(
]),
)

prepare_build_context(
name = "madge_build_context",
srcs = [":src"],
)

madge_check(
name = "check-circular-dependencies",
srcs = [":src"],
Expand All @@ -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"]),
Expand Down
2 changes: 1 addition & 1 deletion toolchains/workspace-pnpm/macros.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ca0c067

Please sign in to comment.