diff --git a/.cirrus.yml b/.cirrus.yml index d3bae53..eefea5c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,5 +8,5 @@ bazel-opt_task: - /src/workspace/tools/inject-repo hs-github-tools test_all_script: - cd /src/workspace && bazel test -k - --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST + --config=ci //hs-github-tools/... diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile index 651b4ad..c6f6625 100644 --- a/.github/docker/Dockerfile +++ b/.github/docker/Dockerfile @@ -1,8 +1,8 @@ FROM toxchat/toktok-stack:haskell AS build RUN ["rm", "-rf", "/work/hs-github-tools"] -COPY --chown=builder:users . /work/hs-github-tools/ -RUN ["stack", "install", "github-tools", "--fast", "--ghc-options", "-j8"] +COPY --chown=builder:users . /work/hs-github-tools +RUN ["stack", "install", "github-tools"] FROM scratch COPY --from=build /home/builder/.local/ / diff --git a/BUILD.bazel b/BUILD.bazel index 4800295..2dc226c 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,3 @@ -load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library") load("@rules_haskell//haskell:defs.bzl", "haskell_library") load("//third_party/haskell/hspec-discover:build_defs.bzl", "hspec_test") load("//tools/project:build_defs.bzl", "project") @@ -17,11 +16,11 @@ haskell_library( src_strip_prefix = "src", visibility = ["//visibility:public"], deps = [ - hazel_library("QuickCheck"), - hazel_library("aeson"), - hazel_library("base"), - hazel_library("quickcheck-text"), - hazel_library("text"), + "//third_party/haskell:QuickCheck", + "//third_party/haskell:aeson", + "//third_party/haskell:base", + "//third_party/haskell:quickcheck-text", + "//third_party/haskell:text", ], ) @@ -36,10 +35,10 @@ haskell_library( visibility = ["//visibility:public"], deps = [ ":github-base", - hazel_library("QuickCheck"), - hazel_library("aeson"), - hazel_library("base"), - hazel_library("text"), + "//third_party/haskell:QuickCheck", + "//third_party/haskell:aeson", + "//third_party/haskell:base", + "//third_party/haskell:text", ], ) @@ -60,29 +59,29 @@ haskell_library( deps = [ ":github-base", ":github-events", - hazel_library("QuickCheck"), - hazel_library("aeson"), - hazel_library("base"), - hazel_library("bytestring"), - hazel_library("containers"), - hazel_library("cryptohash"), - hazel_library("directory"), - hazel_library("exceptions"), - hazel_library("github"), - hazel_library("html"), - hazel_library("http-client"), - hazel_library("http-client-tls"), - hazel_library("monad-parallel"), - hazel_library("process"), - hazel_library("quickcheck-text"), - hazel_library("split"), - hazel_library("tabular"), - hazel_library("text"), - hazel_library("time"), - hazel_library("unordered-containers"), - hazel_library("uuid"), - hazel_library("vector"), - hazel_library("unix"), + "//third_party/haskell:QuickCheck", + "//third_party/haskell:aeson", + "//third_party/haskell:base", + "//third_party/haskell:bytestring", + "//third_party/haskell:containers", + "//third_party/haskell:cryptohash", + "//third_party/haskell:directory", + "//third_party/haskell:exceptions", + "//third_party/haskell:github", + "//third_party/haskell:html", + "//third_party/haskell:http-client", + "//third_party/haskell:http-client-tls", + "//third_party/haskell:monad-parallel", + "//third_party/haskell:process", + "//third_party/haskell:quickcheck-text", + "//third_party/haskell:split", + "//third_party/haskell:tabular", + "//third_party/haskell:text", + "//third_party/haskell:time", + "//third_party/haskell:unix", + "//third_party/haskell:unordered-containers", + "//third_party/haskell:uuid", + "//third_party/haskell:vector", ], ) @@ -102,9 +101,9 @@ hspec_test( ":github-base", ":github-events", ":hs-github-tools", - hazel_library("QuickCheck"), - hazel_library("aeson"), - hazel_library("base"), - hazel_library("hspec"), + "//third_party/haskell:QuickCheck", + "//third_party/haskell:aeson", + "//third_party/haskell:base", + "//third_party/haskell:hspec", ], ) diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index 34fe876..c9f410c 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -1,4 +1,3 @@ -load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library") load("@rules_haskell//haskell:defs.bzl", "haskell_binary") [haskell_binary( @@ -7,9 +6,9 @@ load("@rules_haskell//haskell:defs.bzl", "haskell_binary") visibility = ["//visibility:public"], deps = [ "//hs-github-tools", - hazel_library("base"), - hazel_library("bytestring"), - hazel_library("github"), - hazel_library("text"), + "//third_party/haskell:base", + "//third_party/haskell:bytestring", + "//third_party/haskell:github", + "//third_party/haskell:text", ], ) for file in glob(["*.hs"])] diff --git a/tools/git-submit b/tools/git-submit index a99296a..02defee 100755 --- a/tools/git-submit +++ b/tools/git-submit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu diff --git a/tools/git-sync b/tools/git-sync index e215219..d5108a3 100755 --- a/tools/git-sync +++ b/tools/git-sync @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash REMOTE="" BRANCH="${1-master}" -if (echo "$BRANCH" | grep ':' > /dev/null); then +if (echo "$BRANCH" | grep ':' >/dev/null); then REMOTE="$(echo "$BRANCH" | grep -o '^[^:]*')" BRANCH="$(echo "$BRANCH" | grep -o '[^:]*$')" REMOTE="$(git remote -v | grep ":$REMOTE/.* (push)" | grep -o '^\S*')" @@ -14,7 +14,7 @@ set -eux case "$BRANCH" in --continue) git rebase --continue - BRANCH=`git rev-parse --abbrev-ref HEAD` + BRANCH=$(git rev-parse --abbrev-ref HEAD) ;; master) @@ -26,10 +26,10 @@ case "$BRANCH" in ;; *) - if [ -n "$REMOTE" ] && ! (git branch | grep "^..$BRANCH\$" > /dev/null); then + if [ -n "$REMOTE" ] && ! (git branch | grep "^..$BRANCH\$" >/dev/null); then git checkout --track "$REMOTE/$BRANCH" else - git checkout $BRANCH + git checkout "$BRANCH" fi git rebase upstream/master ;; @@ -37,4 +37,4 @@ esac git push --force git checkout master -git branch -d $BRANCH +git branch -d "$BRANCH" diff --git a/web/BUILD.bazel b/web/BUILD.bazel index d5eb338..091b762 100644 --- a/web/BUILD.bazel +++ b/web/BUILD.bazel @@ -1,4 +1,3 @@ -load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library") load("@rules_haskell//haskell:defs.bzl", "haskell_binary") package(features = ["-layering_check"]) @@ -9,28 +8,28 @@ haskell_binary( visibility = ["//visibility:public"], deps = [ "//hs-github-tools", - hazel_library("Diff"), - hazel_library("aeson-pretty"), - hazel_library("base"), - hazel_library("bytestring"), - hazel_library("case-insensitive"), - hazel_library("containers"), - hazel_library("expiring-cache-map"), - hazel_library("github"), - hazel_library("http-media"), - hazel_library("http-types"), - hazel_library("pretty"), - hazel_library("servant"), - hazel_library("servant-server"), - hazel_library("suspend"), - hazel_library("text"), - hazel_library("time"), - hazel_library("timers"), - hazel_library("unordered-containers"), - hazel_library("uuid"), - hazel_library("wai"), - hazel_library("wai-cors"), - hazel_library("wai-extra"), - hazel_library("warp"), + "//third_party/haskell:Diff", + "//third_party/haskell:aeson-pretty", + "//third_party/haskell:base", + "//third_party/haskell:bytestring", + "//third_party/haskell:case-insensitive", + "//third_party/haskell:containers", + "//third_party/haskell:expiring-cache-map", + "//third_party/haskell:github", + "//third_party/haskell:http-media", + "//third_party/haskell:http-types", + "//third_party/haskell:pretty", + "//third_party/haskell:servant", + "//third_party/haskell:servant-server", + "//third_party/haskell:suspend", + "//third_party/haskell:text", + "//third_party/haskell:time", + "//third_party/haskell:timers", + "//third_party/haskell:unordered-containers", + "//third_party/haskell:uuid", + "//third_party/haskell:wai", + "//third_party/haskell:wai-cors", + "//third_party/haskell:wai-extra", + "//third_party/haskell:warp", ], )