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

Add WORKSPACE tests to CI #59

Merged
merged 6 commits into from
Oct 10, 2023
Merged
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
22 changes: 19 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: "Linting Starlark"
run: bazel run @buildifier_prebuilt//:buildifier -- -mode check -lint warn -r .

build:
build-bzlmod:
runs-on: ubuntu-latest
steps:
- name: "Checkout the sources"
Expand All @@ -34,8 +34,24 @@ jobs:
- name: "Configure Bazel"
run: cp .github/workflows/ci.bazelrc .
- name: "Build"
run: bazel build //...
run: bazel build //... --enable_bzlmod=True
- name: "Unit tests"
run: bazel test //...
run: bazel test //... --enable_bzlmod=True
- name: "Integration tests"
run: bash tests/integration/suite.sh
build-workspace:
runs-on: ubuntu-latest
steps:
- name: "Checkout the sources"
uses: actions/[email protected]
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
- name: "Setup Bazelisk"
uses: bazelbuild/setup-bazelisk@v2
- name: "Configure Bazel"
run: cp .github/workflows/ci.bazelrc .
- name: "Build"
run: bazel build //... --enable_bzlmod=False
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rules_pmd_toolchains()

skylib_version = "1.4.1"

skylib_sha = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa"
skylib_sha = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7"

http_archive(
name = "bazel_skylib",
Expand Down
4 changes: 3 additions & 1 deletion pmd/dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file"
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load(":versions.bzl", _DEFAULT_PMD_VERSION = "DEFAULT_PMD_RELEASE")

_PMD_BUILD_FILE_TEMPLATE = Label("//pmd:BUILD.pmd.bazel")

def rules_pmd_dependencies(pmd_release = _DEFAULT_PMD_VERSION):
"""Fetches `rules_pmd` dependencies.

Expand Down Expand Up @@ -41,5 +43,5 @@ def _rules_pmd_bzlmod_dependencies(pmd_release):
url = "https://github.com/pmd/pmd/releases/download/pmd_releases/{v}/pmd-bin-{v}.zip".format(v = pmd_release.version),
strip_prefix = "pmd-bin-{v}/lib".format(v = pmd_release.version),
sha256 = pmd_release.sha256,
build_file = "//pmd:BUILD.pmd.bazel",
build_file = _PMD_BUILD_FILE_TEMPLATE,
)