Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert website build to eleventy and bazel #19

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.1
7.3.1
13 changes: 0 additions & 13 deletions .githooks/pre-commit

This file was deleted.

28 changes: 17 additions & 11 deletions .github/workflows/github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,26 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@161cd54b698f1fb3ea539faab2e036d409550e3c # v1.187.0
with:
bundler-cache: true
cache-version: 0
# TODO: setup bazel
- name: Setup Bazel
uses: actions/configure-pages@v5

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Build with Jekyll
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
uses: bazel-contrib/[email protected]
with:
bazelisk-version: 1.x
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
# TODO: consider using manifest. see: https://github.com/bazel-contrib/setup-bazel#external-cache
external-cache: true
# TODO: CI specific config
# bazelrc: |
# common --config=ci

- name: Build
run: bazel build //website --//website:path_prefix='${{ steps.pages.outputs.base_path }}'

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bazel-*
.venv/

_site/
node_modules/
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
".aspect/bazelrc": true
},
"cSpell.words": [
"dpkg",
"pydpkg",
"runfile",
"runfiles"
"runfiles",
"scanpackages"
],
"files.associations": {
".envrc*": "shellscript",
".bazelrc": "shellscript"
},
"evenBetterToml.formatter.arrayAutoCollapse": false,
"evenBetterToml.formatter.arrayTrailingComma": true,
"evenBetterToml.formatter.allowedBlankLines": 1,
}
22 changes: 21 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

npm_link_all_packages(name = "node_modules")

compile_pip_requirements(
name = "py_requirements",
src = "py_requirements.in",
srcs = [
"//tools/pkg/scanpackages:pyproject.toml",
],
extra_args = [
"--strip-extras", # becoming the default in piptools compile v8.0.0
],
requirements_txt = "py_requirements_lock.txt",
)

alias(
name = "python",
actual = "@python_3_12//:python3",
)

alias(
name = "node",
actual = "@nodejs//:node",
)

alias(
name = "pnpm",
actual = "@pnpm//:pnpm",
)
5 changes: 0 additions & 5 deletions Gemfile

This file was deleted.

77 changes: 0 additions & 77 deletions Gemfile.lock

This file was deleted.

30 changes: 29 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ bazel_dep(name = "rules_pkg", version = "1.0.1")
# === rules_python ===
# ====================
# FIXME: currently mostly unused, but I expect I'll want to use Python as "glue" somwhere...
bazel_dep(name = "rules_python", version = "0.34.0")
bazel_dep(name = "rules_python", version = "0.35.0")
PY_VERSION = "3.12"
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = PY_VERSION,
is_default = True,
# configure_coverage_tool = True, # https://rules-python.readthedocs.io/en/latest/coverage.html
)
use_repo(python, "python_%s" % PY_VERSION.replace(".", "_"))
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pip",
Expand All @@ -37,6 +38,31 @@ use_repo(pip, "pip")
# ========================
bazel_dep(name = "aspect_bazel_lib", version = "2.7.9")

# ====================
# === rules_nodejs ===
# ====================
bazel_dep(name = "rules_nodejs", version = "6.3.0")

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = "20.14.0")
use_repo(node, "nodejs")

# =======================
# === aspect_rules_js ===
# =======================
bazel_dep(name = "aspect_rules_js", version = "2.0.1")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
# verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
use_repo(pnpm, "pnpm")

# TODO
# =========================
# === aspect_rules_lint ===
Expand All @@ -45,3 +71,5 @@ bazel_dep(name = "aspect_bazel_lib", version = "2.7.9")
# # Next, follow the install instructions for
# # - linting: https://github.com/aspect-build/rules_lint/blob/v1.0.0-rc7/docs/linting.md
# # - formatting: https://github.com/aspect-build/rules_lint/blob/v1.0.0-rc7/docs/formatting.md

bazel_dep(name = "rules_gzip", version = "1.0.0-beta.3")
Loading