mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
66e847bc46
<!-- The PR description should answer 2 (maybe 3) important questions: --> ### What We've had our CI mixed between Github and Buildkite for a while, it's time to commit. First step is moving the "tests" step to Github Actions. <!-- What is this PR trying to accomplish (and why, if it's not obvious)? --> <!-- Consider: do we need to add a changelog entry? --> ### How This PR: - Moves the `test` step to Github Actions - Creates a new `custom_connector.Dockerfile` which builds custom connector only, more quickly. - Changes the metadata tests to use `localhost` instead of their Docker internal names (ie `custom_connector` or `postgres_connector`) - this is because the tests are being run from outside Docker now - Removes the `test` Buildkite step It does not: - Remove the code coverage or benchmarks steps from Buildkite - Tidy up `justfile` or Dockerfiles <!-- How is it trying to accomplish it (what are the implementation steps)? --> --------- Co-authored-by: Philip Lykke Carlsen <plcplc@gmail.com> V3_GIT_ORIGIN_REV_ID: a67534ebc1634a24b48d2620c45003221852e199
40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
# This should match the Rust version in rust-toolchain.yaml and the other Dockerfiles.
|
|
FROM rust:1.79.0
|
|
|
|
WORKDIR app
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN set -ex;\
|
|
apt-get update; \
|
|
apt-get install --no-install-recommends --assume-yes \
|
|
curl git jq pkg-config ssh \
|
|
libssl-dev lld protobuf-compiler
|
|
|
|
# Set up a directory to store Cargo files.
|
|
ENV CARGO_HOME=/app/.cargo
|
|
ENV PATH="$PATH:$CARGO_HOME/bin"
|
|
# Switch to `lld` as the linker.
|
|
ENV RUSTFLAGS="-C link-arg=-fuse-ld=lld"
|
|
# Building with build.rs requires the Git context to be available across volumes.
|
|
ENV GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
|
|
|
# Install Rust tools.
|
|
COPY rust-toolchain.toml .
|
|
RUN rustup show
|
|
|
|
COPY Cargo.toml Cargo.lock .
|
|
|
|
RUN mkdir bin
|
|
|
|
# Build the binaries and tests
|
|
RUN --mount=type=cache,target=/app/.cargo/git --mount=type=cache,target=/app/.cargo/registry \
|
|
--mount=type=cache,target=./target \
|
|
--mount=type=bind,source=./crates,target=./crates \
|
|
set -ex; \
|
|
cargo build --bin custom-connector
|
|
|
|
# Copy the binaries out of the cache
|
|
RUN --mount=type=cache,target=./target \
|
|
find target/debug -maxdepth 1 -type f -executable -exec cp '{}' bin \;
|