From 8fbdb854b5c30909e645b4844d7ad84fb5fb1e62 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Tue, 10 Oct 2023 11:38:58 -0700 Subject: [PATCH 1/6] Add WORKSPACE tests to CI --- .github/workflows/main.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e48b274..c278dd8 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,28 @@ 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=True + - name: "Unit tests" + run: bazel test //... --enable_bzlmod=True - name: "Integration tests" run: bash tests/integration/suite.sh From 750c2b044f3caac6b247541ea737389cc6c86e99 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Tue, 10 Oct 2023 11:39:14 -0700 Subject: [PATCH 2/6] Flip the flags --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c278dd8..ee48ce1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,8 +54,8 @@ jobs: - name: "Configure Bazel" run: cp .github/workflows/ci.bazelrc . - name: "Build" - run: bazel build //... --enable_bzlmod=True + run: bazel build //... --enable_bzlmod=False - name: "Unit tests" - run: bazel test //... --enable_bzlmod=True + run: bazel test //... --enable_bzlmod=False - name: "Integration tests" run: bash tests/integration/suite.sh From 6a199ed80d3ee3442c8a71ea786f6b15d07a0890 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Tue, 10 Oct 2023 11:42:42 -0700 Subject: [PATCH 3/6] Fix skylib sha --- WORKSPACE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From b11a29ee7b16f66bae7342dfafb18b32a2c6d9c5 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Tue, 10 Oct 2023 11:54:50 -0700 Subject: [PATCH 4/6] Run less tests --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee48ce1..e0638bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,3 @@ jobs: run: cp .github/workflows/ci.bazelrc . - name: "Build" run: bazel build //... --enable_bzlmod=False - - name: "Unit tests" - run: bazel test //... --enable_bzlmod=False - - name: "Integration tests" - run: bash tests/integration/suite.sh From 6e25273473938b9666833841aded0c9964c39869 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Tue, 10 Oct 2023 12:51:16 -0700 Subject: [PATCH 5/6] More fixes --- pmd/dependencies.bzl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pmd/dependencies.bzl b/pmd/dependencies.bzl index af38a12..da224bb 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. @@ -19,8 +21,8 @@ def rules_pmd_dependencies(pmd_release = _DEFAULT_PMD_VERSION): # Java - rules_java_version = "5.4.1" - rules_java_sha = "a1f82b730b9c6395d3653032bd7e3a660f9d5ddb1099f427c1e1fe768f92e395" + rules_java_version = "6.5.1" + rules_java_sha = "7b0d9ba216c821ee8697dedc0f9d0a705959ace462a3885fe9ba0347ba950111" maybe( repo_rule = http_archive, @@ -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, ) From ef0e8827ac45bac32775adbcadee5093c3da2fc1 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Tue, 10 Oct 2023 13:03:16 -0700 Subject: [PATCH 6/6] revert --- pmd/dependencies.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd/dependencies.bzl b/pmd/dependencies.bzl index da224bb..dd86242 100644 --- a/pmd/dependencies.bzl +++ b/pmd/dependencies.bzl @@ -21,8 +21,8 @@ def rules_pmd_dependencies(pmd_release = _DEFAULT_PMD_VERSION): # Java - rules_java_version = "6.5.1" - rules_java_sha = "7b0d9ba216c821ee8697dedc0f9d0a705959ace462a3885fe9ba0347ba950111" + rules_java_version = "5.4.1" + rules_java_sha = "a1f82b730b9c6395d3653032bd7e3a660f9d5ddb1099f427c1e1fe768f92e395" maybe( repo_rule = http_archive,