diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e48b274..e0638bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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" @@ -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/checkout@v3.6.0 + - 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 diff --git a/WORKSPACE b/WORKSPACE index a34336f..411fd85 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -22,7 +22,7 @@ rules_pmd_toolchains() skylib_version = "1.4.1" -skylib_sha = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa" +skylib_sha = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7" http_archive( name = "bazel_skylib", diff --git a/pmd/dependencies.bzl b/pmd/dependencies.bzl index af38a12..dd86242 100644 --- a/pmd/dependencies.bzl +++ b/pmd/dependencies.bzl @@ -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. @@ -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, )