Skip to content

Commit

Permalink
setup with example_http_archive_resolved from https://github.com/feno…
Browse files Browse the repository at this point in the history
…llp/bazel_lock

Signed-off-by: Pierre Fenoll <[email protected]>
  • Loading branch information
fenollp committed Apr 4, 2020
1 parent 02dafc3 commit 424b570
Show file tree
Hide file tree
Showing 11 changed files with 1,297 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: push
name: Tests
env:
BAZEL: bazelisk
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For GitHub rules
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test_on_ubuntu:
name: RUN TESTS ON ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./test.sh

test_on_macos:
name: RUN TESTS ON macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- run: ./test.sh

test_on_windows:
name: RUN TESTS ON windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: ./test.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazel-*
3 changes: 3 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
licenses(["notice"]) # Apache 2.0

exports_files(["LICENSE"])
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workspace(name = "bazel_upgradable")
5 changes: 5 additions & 0 deletions example_http_archive_resolved/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# From https://blog.bazel.build/2018/09/28/first-class-resolved-file.html
sync --experimental_repository_resolved_file=resolved.bzl
build --experimental_resolved_file_instead_of_workspace=resolved.bzl
build --experimental_repository_hash_file=resolved.bzl
build --experimental_verify_repository_rules=@bazel_tools//tools/build_defs/repo:git.bzl%git_repository
22 changes: 22 additions & 0 deletions example_http_archive_resolved/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
alias(
name = "hello",
actual = select({
"on_windows": ":hello_on_windows.bat",
"//conditions:default": ":hello_sh",
}),
)

config_setting(
name = "on_windows",
constraint_values = ["@platforms//os:windows"],
)

sh_binary(
name = "hello_sh",
srcs = ["hello.sh"],
)

sh_binary(
name = "hello_on_windows.bat",
srcs = ["hello.bat"],
)
14 changes: 14 additions & 0 deletions example_http_archive_resolved/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
workspace(name = "example_http_archive_resolved")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
type = "tar.gz",
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/0.8.0/bazel-skylib.0.8.0.tar.gz",
)

load("@bazel_skylib//lib:versions.bzl", "versions")

# Not an actual requirement. This is only to demonstrate usage of http_archive
versions.check(minimum_bazel_version = "0.19")
2 changes: 2 additions & 0 deletions example_http_archive_resolved/hello.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
echo "Hello!"
3 changes: 3 additions & 0 deletions example_http_archive_resolved/hello.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -eu

echo Hello!
Loading

0 comments on commit 424b570

Please sign in to comment.