Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
betaboon committed Dec 6, 2024
1 parent a4a2124 commit 0c515bb
Show file tree
Hide file tree
Showing 28 changed files with 3,393 additions and 4 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,44 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
# TODO migrate this to `test`-job
dev-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: DamianReeves/write-file-action@master
with:
path: .bazelrc.ci
contents: ${{secrets.BAZELRC_CI || '# no rbe access'}}
write-mode: overwrite

- name: Everything except //pycross/...
run: |
bazel test -- //... -//pycross/...
test:
uses: ./.github/workflows/bazel.yaml
with:
# 6.x currently unsupported by rules-template. see: https://github.com/bazel-contrib/.github/issues/22
bazelversions: |
[
"6.x",
"7.x",
]
folders: |
[
".",
"e2e/workspace",
"e2e/bzlmod"
"e2e.new/bzlmod/pdm/lock_file",
"e2e.new/bzlmod/poetry/lock_file"
"e2e.new/workspace/pdm/lock_file",
"e2e.new/workspace/poetry/lock_file"
]
excludes: |
[
{"bzlmodEnabled": true, "folder": "e2e.new/workspace/pdm/lock_file"},
{"bzlmodEnabled": true, "folder": "e2e.new/workspace/poetry/lock_file"},
{"bzlmodEnabled": false, "folder": "e2e.new/bzlmod/pdm/lock_file"},
{"bzlmodEnabled": false, "folder": "e2e.new/bzlmod/poetry/lock_file"},
]
# For branch protection settings, this job provides a "stable" name that can be used to gate PR merges
# on "all matrix jobs were successful".
Expand Down
25 changes: 25 additions & 0 deletions e2e.new/bzlmod/pdm/lock_file/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@rules_pycross//pycross:defs.bzl", "pycross_lock_file", "pycross_pdm_lock_model")

package(default_visibility = ["//visibility:public"])

pycross_pdm_lock_model(
name = "lock_model",
lock_file = "//:pdm.lock",
project_file = "//:pyproject.toml",
)

pycross_lock_file(
name = "lock_file",
out = "updated_lock_file.bzl",
default_alias_single_version = True,
lock_model_file = ":lock_model",
target_environments = ["@smoke_environments//:environments"],
)

write_source_files(
name = "update_lock",
files = {
"lock_file.bzl": ":updated_lock_file.bzl",
},
)
37 changes: 37 additions & 0 deletions e2e.new/bzlmod/pdm/lock_file/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
bazel_dep(name = "aspect_bazel_lib", version = "2.3.0")
bazel_dep(name = "rules_pycross", version = "0.0.0")
bazel_dep(name = "rules_python", version = "0.31.0")

local_path_override(
module_name = "rules_pycross",
path = "../../../..",
)

# rules_python
python = use_extension("@rules_python//python/extensions:python.bzl", "python")

# The default is latest - 1 to make sure nothing assumes latest == default
python.toolchain(
is_default = True,
python_version = "3.11.6",
)
python.toolchain(python_version = "3.10.11")
python.toolchain(python_version = "3.12.0")

# rules_pycross
environments = use_extension("@rules_pycross//pycross/extensions:environments.bzl", "environments")
environments.create_for_python_toolchains(
name = "smoke_environments",
platforms = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
],
python_versions = [
"3.10.11",
"3.11.6",
"3.12.0",
"3.12",
],
)
use_repo(environments, "smoke_environments")
328 changes: 328 additions & 0 deletions e2e.new/bzlmod/pdm/lock_file/lock_file.bzl

Large diffs are not rendered by default.

233 changes: 233 additions & 0 deletions e2e.new/bzlmod/pdm/lock_file/pdm.lock

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions e2e.new/bzlmod/pdm/lock_file/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[project]
name = "rules-pycross-test"
version = "0.1.0"
description = ""
authors = []
dependencies = [
"regex>=2024.11.6",
"zstandard>=0.23.0",
]
requires-python = ">=3.9, <3.13"
license = {text = "MIT"}
25 changes: 25 additions & 0 deletions e2e.new/bzlmod/poetry/lock_file/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@rules_pycross//pycross:defs.bzl", "pycross_lock_file", "pycross_poetry_lock_model")

package(default_visibility = ["//visibility:public"])

pycross_poetry_lock_model(
name = "lock_model",
lock_file = "//:poetry.lock",
project_file = "//:pyproject.toml",
)

pycross_lock_file(
name = "lock_file",
out = "updated_lock_file.bzl",
default_alias_single_version = True,
lock_model_file = ":lock_model",
target_environments = ["@smoke_environments//:environments"],
)

write_source_files(
name = "update_lock",
files = {
"lock_file.bzl": ":updated_lock_file.bzl",
},
)
37 changes: 37 additions & 0 deletions e2e.new/bzlmod/poetry/lock_file/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
bazel_dep(name = "aspect_bazel_lib", version = "2.3.0")
bazel_dep(name = "rules_pycross", version = "0.0.0")
bazel_dep(name = "rules_python", version = "0.31.0")

local_path_override(
module_name = "rules_pycross",
path = "../../../..",
)

# rules_python
python = use_extension("@rules_python//python/extensions:python.bzl", "python")

# The default is latest - 1 to make sure nothing assumes latest == default
python.toolchain(
is_default = True,
python_version = "3.11.6",
)
python.toolchain(python_version = "3.10.11")
python.toolchain(python_version = "3.12.0")

# rules_pycross
environments = use_extension("@rules_pycross//pycross/extensions:environments.bzl", "environments")
environments.create_for_python_toolchains(
name = "smoke_environments",
platforms = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
],
python_versions = [
"3.10.11",
"3.11.6",
"3.12.0",
"3.12",
],
)
use_repo(environments, "smoke_environments")
Loading

0 comments on commit 0c515bb

Please sign in to comment.