mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
Add docker for integration tests (#26)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
FROM rust:latest
|
||||
|
||||
# Install Node.js
|
||||
ENV NODE_VERSION 12.0.0
|
||||
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash \
|
||||
&& . $HOME/.nvm/nvm.sh \
|
||||
&& nvm install $NODE_VERSION \
|
||||
&& nvm alias default $NODE_VERSION \
|
||||
&& nvm use default
|
||||
ENV PATH /root/.nvm/versions/node/v$NODE_VERSION/bin:$PATH
|
||||
# Check that Node.js was correctly installed
|
||||
RUN node --version
|
||||
|
||||
# Create blank project
|
||||
RUN USER=root cargo new --bin starship
|
||||
WORKDIR /starship
|
||||
|
||||
# We want dependencies cached, so copy those first
|
||||
COPY ./Cargo.lock ./Cargo.lock
|
||||
COPY ./Cargo.toml ./Cargo.toml
|
||||
|
||||
# Cargo.toml will fail to parse without my_benchmark
|
||||
RUN mkdir benches
|
||||
RUN touch benches/my_benchmark.rs
|
||||
|
||||
# This is a dummy build to get dependencies cached
|
||||
RUN cargo build --release
|
||||
|
||||
# Delete the dummy build
|
||||
RUN rm -rf /starship
|
||||
|
||||
# Create the directory for the real source files
|
||||
RUN mkdir starship
|
||||
WORKDIR /starship
|
||||
|
||||
CMD [ "cargo", "test", "--", "--ignored"]
|
||||
Reference in New Issue
Block a user