Skip to content

Commit cfa8509

Browse files
authored
chore: replace ci (#391)
1 parent 0fbc303 commit cfa8509

26 files changed

Lines changed: 1360 additions & 149 deletions

File tree

.aspect/cli/config.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.aspect/workflows/bazelrc

Lines changed: 0 additions & 69 deletions
This file was deleted.

.aspect/workflows/config.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.bazeliskrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

.bazelversion

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
8.5.0
1+
9.1.1
2+

.github/workflows/ci.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
workflow_dispatch:
8+
concurrency:
9+
# Cancel previous actions from the same PR or branch except 'main' branch.
10+
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info.
11+
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}}
12+
cancel-in-progress: ${{ github.ref_name != 'main' }}
13+
jobs:
14+
buildifier:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
18+
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
19+
with:
20+
# Avoid downloading Bazel every time.
21+
bazelisk-cache: true
22+
# Store build cache per workflow.
23+
disk-cache: ${{ github.workflow }}
24+
# Share repository cache between workflows.
25+
repository-cache: true
26+
# Don't save cache on pull requests to avoid polluting it
27+
cache-save: ${{ github.event_name != 'pull_request' }}
28+
- run: bazel run //tools/format:format.check --config=ci
29+
gazelle:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
33+
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
34+
with:
35+
# Avoid downloading Bazel every time.
36+
bazelisk-cache: true
37+
# Store build cache per workflow.
38+
disk-cache: ${{ github.workflow }}
39+
# Share repository cache between workflows.
40+
repository-cache: true
41+
# Don't save cache on pull requests to avoid polluting it
42+
cache-save: ${{ github.event_name != 'pull_request' }}
43+
- run: bazel run //:gazelle.check --config=ci
44+
format:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
48+
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
49+
with:
50+
# Avoid downloading Bazel every time.
51+
bazelisk-cache: true
52+
# Store build cache per workflow.
53+
disk-cache: ${{ github.workflow }}
54+
# Share repository cache between workflows.
55+
repository-cache: true
56+
# Don't save cache on pull requests to avoid polluting it
57+
cache-save: ${{ github.event_name != 'pull_request' }}
58+
- run: bazel run //tools/format:format.check --config=ci
59+
test:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
63+
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
64+
with:
65+
# Avoid downloading Bazel every time.
66+
bazelisk-cache: true
67+
# Store build cache per workflow.
68+
disk-cache: ${{ github.workflow }}
69+
# Share repository cache between workflows.
70+
repository-cache: true
71+
# Don't save cache on pull requests to avoid polluting it
72+
cache-save: ${{ github.event_name != 'pull_request' }}
73+
- run: bazel test //... --config=ci

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
bazel-*
2-
MODULE.bazel.lock
32
node_modules
43
.DS_Store
54
.terraform
65
*.tfstate.backup
76
*.terraform.lock.hcl
8-
*.tfstate
7+
*.tfstate

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ repos:
1616
language: system
1717
entry: bazel run //:format
1818
files: .*
19+
- id: gazelle
20+
name: Gazelle
21+
language: system
22+
entry: bazel run //:gazelle
23+
files: .*
1924
- repo: https://github.com/keith/pre-commit-buildifier
2025
rev: 8.2.1
2126
hooks:

BUILD.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@aspect_gazelle_prebuilt//:def.bzl", "aspect_gazelle")
12
load("@aspect_rules_js//js:defs.bzl", "js_library")
23
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
34
load("@npm//:defs.bzl", "npm_link_all_packages")
@@ -18,6 +19,9 @@ ts_project(
1819
srcs = [
1920
"jest.setup.ts",
2021
],
22+
allow_js = True,
23+
source_map = True,
24+
tsconfig = ":tsconfig",
2125
visibility = ["//src:__subpackages__"],
2226
deps = [
2327
":node_modules/@jest/globals",
@@ -67,6 +71,11 @@ buildifier(
6771
mode = "diff",
6872
)
6973

74+
aspect_gazelle(
75+
languages = ["js"],
76+
with_check = True,
77+
)
78+
7079
alias(
7180
name = "format",
7281
actual = "//tools/format",

MODULE.bazel

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
bazel_dep(name = "aspect_bazel_lib", version = "2.22.0")
2+
bazel_dep(name = "aspect_gazelle_prebuilt", version = "0.0.18")
23
bazel_dep(name = "aspect_rules_esbuild", version = "0.25.0")
34
bazel_dep(name = "aspect_rules_jest", version = "0.24.3")
45
bazel_dep(name = "aspect_rules_js", version = "2.8.3")
56
bazel_dep(name = "aspect_rules_lint", version = "1.13.0")
67
bazel_dep(name = "aspect_rules_ts", version = "3.8.1")
78

8-
bazel_dep(name = "bazelrc-preset.bzl", version = "1.8.0", dev_dependency = True)
9+
bazel_dep(name = "bazelrc-preset.bzl", version = "1.9.2", dev_dependency = True)
910

1011
bazel_dep(
1112
name = "buildifier_prebuilt",
1213
version = "8.2.1.1",
1314
)
1415
bazel_dep(name = "platforms", version = "1.0.0")
1516
bazel_dep(name = "rules_cc", version = "0.2.16")
17+
bazel_dep(name = "rules_go", version = "0.59.0")
1618
bazel_dep(name = "rules_multitool", version = "1.11.1")
17-
bazel_dep(name = "rules_nodejs", version = "6.3.3")
19+
bazel_dep(name = "rules_nodejs", version = "6.7.4")
1820
bazel_dep(name = "rules_pkg", version = "1.1.0")
1921
bazel_dep(name = "rules_shell", version = "0.6.1")
2022
bazel_dep(name = "rules_xz", version = "1.0.1")

0 commit comments

Comments
 (0)