-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement directives to set the repos for dependencies
- Loading branch information
1 parent
d354ee8
commit 1c22dc7
Showing
27 changed files
with
452 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
example | ||
tests/alternative-deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
steps: | ||
- label: "Build" | ||
- label: "Build and unit tests" | ||
command: | | ||
echo "build --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host" > .bazelrc.local | ||
echo build --repository_cache=~/.bazel_repo_cache >> .bazelrc.local | ||
echo build --disk_cache=~/.bazel_disk_cache >> .bazelrc.local | ||
nix-shell --pure --run 'bazel build //...' | ||
This comment has been minimized.
Sorry, something went wrong. |
||
nix-shell --pure --run 'bazel test //...' | ||
timeout: 30 | ||
- label: "Test" | ||
- label: "Test the example" | ||
command: | | ||
nix-shell --pure --run 'bazel test //...' | ||
ln -sr .bazelrc.local example/.bazelrc.local | ||
cd example | ||
nix-shell --pure --run 'bazel run //:gazelle' | ||
nix-shell --pure --run 'bazel run //:gazelle-update-repos' | ||
nix-shell --pure --run 'bazel build //...' | ||
nix-shell --pure --run 'bazel test //...' | ||
timeout: 30 | ||
- label: "Test alternative dependencies" | ||
command: | | ||
nix-shell --pure --run 'bazel test //...' | ||
ln -sr .bazelrc.local tests/alternative-deps/.bazelrc.local | ||
cd tests/alternative-deps | ||
nix-shell --pure --run 'bazel run //:gazelle' | ||
nix-shell --pure --run 'bazel run //:gazelle-update-repos' | ||
nix-shell --pure --run 'bazel build //...' | ||
nix-shell --pure --run 'bazel test //...' | ||
timeout: 30 | ||
- label: "Test" | ||
- label: "buildifier linting" | ||
command: | | ||
nix-shell --pure --run 'bazel run //:buildifier-diff' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../.bazelrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
load( | ||
"@bazel_gazelle//:def.bzl", | ||
"DEFAULT_LANGUAGES", | ||
"gazelle", | ||
"gazelle_binary", | ||
) | ||
load("@rules_haskell//haskell:defs.bzl", "ghc_plugin") | ||
|
||
# gazelle:cabal_extra_libraries [email protected]//:zlib | ||
# gazelle:cabal_haskell_package_repo stackage-b | ||
gazelle( | ||
name = "gazelle", | ||
data = ["@io_tweag_gazelle_cabal//cabalscan"], | ||
gazelle = "//:gazelle_binary", | ||
) | ||
|
||
gazelle_binary( | ||
name = "gazelle_binary", | ||
languages = DEFAULT_LANGUAGES + ["@io_tweag_gazelle_cabal//gazelle_cabal"], | ||
) | ||
|
||
gazelle( | ||
name = "gazelle-update-repos", | ||
command = "update-repos", | ||
data = ["@io_tweag_gazelle_cabal//cabalscan"], | ||
extra_args = [ | ||
"-lang", | ||
"gazelle_cabal", | ||
"stackage-b", | ||
], | ||
gazelle = "//:gazelle_binary", | ||
) | ||
|
||
ghc_plugin( | ||
name = "inspection-testing-plugin", | ||
module = "Test.Inspection.Plugin", | ||
visibility = ["//:__subpackages__"], | ||
deps = ["@stackage-b//:inspection-testing"], | ||
) |
Oops, something went wrong.
bazel build //...
is redundant next tobazel test //...
. See bazelbuild/bazel#4257 (comment). Runningbazel test //...
only can be a bit faster as Bazel can interleave build steps and test execution.