From a4a793183615cf5f3351f753d4984ee16d5d1103 Mon Sep 17 00:00:00 2001 From: Liam Monninger Date: Sat, 23 Sep 2023 18:02:29 -0700 Subject: [PATCH] [CICD] reintroducing caching --- .devcontainer/Dockerfile | 0 .devcontainer/devcontainer.json | 0 .devcontainer/ubuntu/Dockerfile | 24 ++++++++++++++++++++++++ .devcontainer/ubuntu/devcontainer.json | 19 +++++++++++++++++++ .github/workflows/check.yml | 12 +++++++++--- 5 files changed, 52 insertions(+), 3 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/ubuntu/Dockerfile create mode 100644 .devcontainer/ubuntu/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index e69de29b..00000000 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index e69de29b..00000000 diff --git a/.devcontainer/ubuntu/Dockerfile b/.devcontainer/ubuntu/Dockerfile new file mode 100644 index 00000000..94941b9c --- /dev/null +++ b/.devcontainer/ubuntu/Dockerfile @@ -0,0 +1,24 @@ +# Use the official Ubuntu image as a base +FROM ubuntu:latest + +# Set environment variables to non-interactive (this prevents some prompts) +ENV DEBIAN_FRONTEND=non-interactive + +# Install necessary tools and libraries +RUN apt-get update && apt-get install -y \ + curl \ + build-essential \ + pkg-config \ + libssl-dev + +# Install Rust using rustup +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + +# Add Rust to the PATH +ENV PATH="/root/.cargo/bin:${PATH}" + +# Set the working directory in the container +WORKDIR /workspace + +# Command to run on container start +CMD [ "bash" ] diff --git a/.devcontainer/ubuntu/devcontainer.json b/.devcontainer/ubuntu/devcontainer.json new file mode 100644 index 00000000..7660e3a9 --- /dev/null +++ b/.devcontainer/ubuntu/devcontainer.json @@ -0,0 +1,19 @@ +{ + "name": "ubuntu", + "dockerFile": "Dockerfile", + "context": ".", + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + "extensions": [ + "rust-lang.rust" + ], + "forwardPorts": [], + "postCreateCommand": "cargo check", + "remoteUser": "root" +} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b666c6ae..8e85b6e3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,13 +26,19 @@ jobs: uses: actions/cache@v2 with: path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-v2 - + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index uses: actions/cache@v2 with: path: ~/.cargo/git - key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}-v2 + key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo build + uses: actions/cache@v2 + with: + path: ./m1/target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - name: Run Cargo Check working-directory: ./m1