Skip to content

Commit

Permalink
[CICD] reintroducing caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam Monninger authored and Liam Monninger committed Sep 24, 2023
1 parent 6f2204d commit a4a7931
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
Empty file removed .devcontainer/Dockerfile
Empty file.
Empty file removed .devcontainer/devcontainer.json
Empty file.
24 changes: 24 additions & 0 deletions .devcontainer/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
19 changes: 19 additions & 0 deletions .devcontainer/ubuntu/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
12 changes: 9 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a4a7931

Please sign in to comment.