diff options
author | Andrew Gallant <jamslam@gmail.com> | 2020-02-18 18:15:30 -0500 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2020-02-20 16:07:51 -0500 |
commit | da3431b4780a2654cdbb35613ff428cdef3fc8fe (patch) | |
tree | 64e37666e1488d6a7a06f83ac7e18a2f4aba8ae2 /ci | |
parent | f314b0d55f2fa7c9f19b677624a19a7ba24c7cf4 (diff) |
ci: switch build to GitHub Actions
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/cargo-out-dir | 19 | ||||
-rw-r--r-- | ci/docker/README.md | 24 | ||||
-rw-r--r-- | ci/docker/arm-unknown-linux-gnueabihf/Dockerfile | 4 | ||||
-rwxr-xr-x | ci/docker/arm-unknown-linux-gnueabihf/build | 5 | ||||
-rw-r--r-- | ci/docker/i686-unknown-linux-gnu/Dockerfile | 4 | ||||
-rwxr-xr-x | ci/docker/i686-unknown-linux-gnu/build | 5 | ||||
-rw-r--r-- | ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile | 4 | ||||
-rwxr-xr-x | ci/docker/mips64-unknown-linux-gnuabi64/build | 5 | ||||
-rw-r--r-- | ci/docker/x86_64-unknown-linux-musl/Dockerfile | 5 | ||||
-rwxr-xr-x | ci/docker/x86_64-unknown-linux-musl/build | 5 | ||||
-rwxr-xr-x | ci/macos-install-packages | 3 | ||||
-rwxr-xr-x | ci/test_complete.sh | 2 | ||||
-rwxr-xr-x | ci/ubuntu-install-packages | 6 |
13 files changed, 87 insertions, 4 deletions
diff --git a/ci/cargo-out-dir b/ci/cargo-out-dir new file mode 100755 index 00000000..2b08d616 --- /dev/null +++ b/ci/cargo-out-dir @@ -0,0 +1,19 @@ +#!/bin/bash + +# Finds Cargo's `OUT_DIR` directory from the most recent build. +# +# This requires one parameter corresponding to the target directory +# to search for the build output. + +if [ $# != 1 ]; then + echo "Usage: $(basename "$0") <target-dir>" >&2 + exit 2 +fi + +# This works by finding the most recent stamp file, which is produced by +# every ripgrep build. +target_dir="$1" +find "$target_dir" -name ripgrep-stamp -print0 \ + | xargs -0 ls -t \ + | head -n1 \ + | xargs dirname diff --git a/ci/docker/README.md b/ci/docker/README.md new file mode 100644 index 00000000..58f367ef --- /dev/null +++ b/ci/docker/README.md @@ -0,0 +1,24 @@ +These are Docker images used for cross compilation in CI builds (or locally) +via the [Cross](https://github.com/rust-embedded/cross) tool. + +The Cross tool actually provides its own Docker images, and all Docker images +in this directory are derived from one of them. We provide our own in order +to customize the environment. For example, we need to install some things like +`asciidoc` in order to generate man pages. We also install compression tools +like `xz` so that tests for the `-z/--search-zip` flag are run. + +If you make a change to a Docker image, then you can re-build it. `cd` into the +directory containing the `Dockerfile` and run: + + $ cd x86_64-unknown-linux-musl + $ ./build + +At this point, subsequent uses of `cross` will now use your built image since +Docker prefers local images over remote images. In order to make these changes +stick, they need to be pushed to Docker Hub: + + $ docker push burntsushi/cross:x86_64-unknown-linux-musl + +Of course, only I (BurntSushi) can push to that location. To make `cross` use +a different location, then edit `Cross.toml` in the root of this repo to use +a different image name for the desired target. diff --git a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile new file mode 100644 index 00000000..59901cb5 --- /dev/null +++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -0,0 +1,4 @@ +FROM rustembedded/cross:arm-unknown-linux-gnueabihf + +COPY stage/ubuntu-install-packages / +RUN /ubuntu-install-packages diff --git a/ci/docker/arm-unknown-linux-gnueabihf/build b/ci/docker/arm-unknown-linux-gnueabihf/build new file mode 100755 index 00000000..107b8369 --- /dev/null +++ b/ci/docker/arm-unknown-linux-gnueabihf/build @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p stage +cp ../../ubuntu-install-packages ./stage/ +docker build -t burntsushi/cross:arm-unknown-linux-gnueabihf . diff --git a/ci/docker/i686-unknown-linux-gnu/Dockerfile b/ci/docker/i686-unknown-linux-gnu/Dockerfile new file mode 100644 index 00000000..9c9107ea --- /dev/null +++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile @@ -0,0 +1,4 @@ +FROM rustembedded/cross:i686-unknown-linux-gnu + +COPY stage/ubuntu-install-packages / +RUN /ubuntu-install-packages diff --git a/ci/docker/i686-unknown-linux-gnu/build b/ci/docker/i686-unknown-linux-gnu/build new file mode 100755 index 00000000..5837c828 --- /dev/null +++ b/ci/docker/i686-unknown-linux-gnu/build @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p stage +cp ../../ubuntu-install-packages ./stage/ +docker build -t burntsushi/cross:i686-unknown-linux-gnu . diff --git a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile new file mode 100644 index 00000000..4b14616b --- /dev/null +++ b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile @@ -0,0 +1,4 @@ +FROM rustembedded/cross:mips64-unknown-linux-gnuabi64 + +COPY stage/ubuntu-install-packages / +RUN /ubuntu-install-packages diff --git a/ci/docker/mips64-unknown-linux-gnuabi64/build b/ci/docker/mips64-unknown-linux-gnuabi64/build new file mode 100755 index 00000000..a15ca352 --- /dev/null +++ b/ci/docker/mips64-unknown-linux-gnuabi64/build @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p stage +cp ../../ubuntu-install-packages ./stage/ +docker build -t burntsushi/cross:mips64-unknown-linux-gnuabi64 . diff --git a/ci/docker/x86_64-unknown-linux-musl/Dockerfile b/ci/docker/x86_64-unknown-linux-musl/Dockerfile index 0405c0c4..8818b605 100644 --- a/ci/docker/x86_64-unknown-linux-musl/Dockerfile +++ b/ci/docker/x86_64-unknown-linux-musl/Dockerfile @@ -1,5 +1,4 @@ FROM rustembedded/cross:x86_64-unknown-linux-musl -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - libxslt1-dev asciidoc docbook-xsl xsltproc libxml2-utils +COPY stage/ubuntu-install-packages / +RUN /ubuntu-install-packages diff --git a/ci/docker/x86_64-unknown-linux-musl/build b/ci/docker/x86_64-unknown-linux-musl/build new file mode 100755 index 00000000..7fce7c2a --- /dev/null +++ b/ci/docker/x86_64-unknown-linux-musl/build @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p stage +cp ../../ubuntu-install-packages ./stage/ +docker build -t burntsushi/cross:x86_64-unknown-linux-musl . diff --git a/ci/macos-install-packages b/ci/macos-install-packages new file mode 100755 index 00000000..309562f7 --- /dev/null +++ b/ci/macos-install-packages @@ -0,0 +1,3 @@ +#!/bin/sh + +brew install asciidoc docbook-xsl diff --git a/ci/test_complete.sh b/ci/test_complete.sh index 0268de89..ff11c802 100755 --- a/ci/test_complete.sh +++ b/ci/test_complete.sh @@ -18,7 +18,7 @@ get_comp_args() { main() { local diff - local rg="${0:a:h}/../target/${TARGET:-}/release/rg" + local rg="${0:a:h}/../${TARGET_DIR:-target}/release/rg" local _rg="${0:a:h}/../complete/_rg" local -a help_args comp_args diff --git a/ci/ubuntu-install-packages b/ci/ubuntu-install-packages new file mode 100755 index 00000000..edaac6f4 --- /dev/null +++ b/ci/ubuntu-install-packages @@ -0,0 +1,6 @@ +#!/bin/sh + +sudo apt-get update +sudo apt-get install -y --no-install-recommends \ + libxslt1-dev asciidoc docbook-xsl xsltproc libxml2-utils \ + zsh xz-utils liblz4-tool musl-tools |