Skip to content

Commit f5578b0

Browse files
authored
Merge pull request #1471 from tweag/gh-actions-all
Move Linux CI jobs to GitHub Actions
2 parents 451e815 + 12ae95c commit f5578b0

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

.bazelrc

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ test --test_env=LANG=C.UTF-8 --test_env=LOCALE_ARCHIVE
1212

1313
# Platform / Toolchain Selection
1414
# ------------------------------
15+
build:linux-nixpkgs --config=nixpkgs
16+
build:macos-nixpkgs --config=nixpkgs
1517
build:nixpkgs --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host
1618
# Use this configuration when targeting Windows. Eventually this will
1719
# no longer be required:

.github/workflows/workflow.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ jobs:
2424
nix_path: nixpkgs=./nixpkgs/default.nix
2525
- name: Configure
2626
run: |
27-
[[ ${{ matrix.os }} == macos ]] && EXTRA_CONFIG=--config=macos-nixpkgs
27+
case ${{ matrix.os }} in
28+
macos) BUILD_CONFIG=macos-nixpkgs;;
29+
ubuntu) BUILD_CONFIG=linux-nixpkgs;;
30+
esac
2831
cat >.bazelrc.local <<EOF
2932
common --config=ci
30-
build --config=nixpkgs $EXTRA_CONFIG
33+
build --config=$BUILD_CONFIG
3134
EOF
3235
- name: Check Bazel version
3336
run: |

.mergify.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
pull_request_rules:
22
- name: automatic merge
33
conditions:
4-
- 'status-success~=Build & Test - macOS \(Nixpkgs\).*'
5-
- 'status-success~=Build & Test - macOS \(bindist\).*'
6-
- "status-success~=buildkite/rules-haskell(|/pr)"
4+
- 'status-success~=Build & Test - Nixpkgs \(ubuntu\).*'
5+
- 'status-success~=Build & Test - Nixpkgs \(macos\).*'
6+
- 'status-success~=Build & Test - bindist \(ubuntu\).*'
7+
- 'status-success~=Build & Test - bindist \(macos\).*'
78
- "status-success=tweag.rules_haskell"
89
- "status-success=deploy/netlify"
910
- "#approved-reviews-by>=1"

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Haskell rules for [Bazel][bazel]
44

5-
![Continuous integration](https://github.com/tweag/rules_haskell/workflows/Continuous%20integration/badge.svg)
5+
[![Continuous integration](https://github.com/tweag/rules_haskell/workflows/Continuous%20integration/badge.svg)](https://github.com/tweag/rules_haskell/actions?query=branch%3Amaster)
66
[![Build Status](https://dev.azure.com/tweag/rules_haskell/_apis/build/status/tweag.rules_haskell?branchName=master)](https://dev.azure.com/tweag/rules_haskell/_build/latest?definitionId=1?branchName=master)
77

88
Bazel automates building and testing software. It scales to very large
@@ -254,26 +254,26 @@ This chooses the `cc_toolchain` bundled with GHC.
254254
### Configuring your platform
255255

256256
`rules_haskell` can be built and tested on Linux, MacOS, and Windows. Depending
257-
on the platform GHC can be provisioned using Nixpkgs or by downloading a binary
257+
on the platform GHC can be provisioned using nixpkgs or by downloading a binary
258258
distribution. In case of nixpkgs other toolchains (C compiler, Python, shell
259259
tools) will also be provided by nixpkgs, in case of bindist they will be taken
260260
from the environment (`$PATH`). The following `--config` options select the
261261
corresponding combination of operating system and GHC distribution:
262262

263263
| | Linux | MacOS | Windows |
264264
| ------------------- | --------------- | --------------- | ----------------- |
265-
| Nixpkgs | (unneeded) | `macos-nixpkgs` | (unsupported) |
266-
| Binary distribution | `linux-bindist` | `macos-bindist` | `windows-bindist` |
265+
| nixpkgs | `linux-nixpkgs` | `macos-nixpkgs` | |
266+
| binary distribution | `linux-bindist` | `macos-bindist` | `windows-bindist` |
267267

268268
Hint: You can use Bazel's `--announce_rc` flag to see what options are being
269269
used for a command in a specific configuration. E.g.
270270
```
271-
$ bazel build //tests:run-tests --config linux-bindist --nobuild --announce_rc
271+
$ bazel build //tests:run-tests --config linux-nixpkgs --nobuild --announce_rc
272272
```
273273

274274
Hint: To avoid repetition you can add your configuration to `.bazelrc.local`.
275275
```
276-
echo "build --config=linux-bindist" >>.bazelrc.local
276+
echo "build --config=linux-nixpkgs" >>.bazelrc.local
277277
```
278278

279279
### Saving common command-line flags to a file

tests/haddock_protobuf/BUILD.bazel

+5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ load("//haskell:protobuf.bzl", "haskell_proto_library")
99
proto_library(
1010
name = "hello_world_proto",
1111
srcs = ["hello_world.proto"],
12+
tags = ["requires_proto"],
1213
)
1314

1415
haskell_proto_library(
1516
name = "hello_world_haskell_proto",
17+
tags = ["requires_proto"],
1618
deps = [
1719
":hello_world_proto",
1820
],
@@ -21,6 +23,7 @@ haskell_proto_library(
2123
haskell_library(
2224
name = "hello_world_haskell",
2325
srcs = ["HelloWorld.hs"], # Just imports the proto and does something trivial
26+
tags = ["requires_proto"],
2427
deps = [
2528
":hello_world_haskell_proto",
2629
"@stackage//:base",
@@ -30,6 +33,7 @@ haskell_library(
3033
# Haddocks version A: depend on just the haskell_library
3134
haskell_doc(
3235
name = "haddocks_a",
36+
tags = ["requires_proto"],
3337
deps = [
3438
":hello_world_haskell",
3539
],
@@ -38,6 +42,7 @@ haskell_doc(
3842
# Haddocks version B: depend on both haskell_library and haskell_proto_library
3943
haskell_doc(
4044
name = "haddocks_b",
45+
tags = ["requires_proto"],
4146
deps = [
4247
":hello_world_haskell",
4348
":hello_world_haskell_proto",

tests/haskell_proto_simple/BUILD.bazel

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ load(
1212
proto_library(
1313
name = "foo",
1414
srcs = ["foo.proto"],
15+
tags = ["requires_proto"],
1516
deps = ["@com_google_protobuf//:descriptor_proto"],
1617
)
1718

1819
haskell_proto_library(
1920
name = "foo_haskell",
21+
tags = ["requires_proto"],
2022
deps = [
2123
":foo",
2224
],
@@ -25,9 +27,7 @@ haskell_proto_library(
2527
haskell_library(
2628
name = "hs-lib",
2729
srcs = ["Bar.hs"],
28-
tags = [
29-
"requires_proto",
30-
],
30+
tags = ["requires_proto"],
3131
visibility = ["//visibility:public"],
3232
deps = [
3333
":foo_haskell",

0 commit comments

Comments
 (0)