Skip to content

Commit

Permalink
Add WORKSPACE tests to CI (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bencodes authored Oct 10, 2023
1 parent 7d4c626 commit 9364dca
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
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,
)

0 comments on commit 9364dca

Please sign in to comment.