Skip to content

Commit 72f52ff

Browse files
committed
Updated dependencies, added CI caching, fixed devcontainer
1 parent 3ce09c4 commit 72f52ff

File tree

7 files changed

+242
-138
lines changed

7 files changed

+242
-138
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/rust/.devcontainer/base.Dockerfile
22

33
# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye
4-
ARG VARIANT="buster"
5-
FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT}
4+
FROM mcr.microsoft.com/devcontainers/rust:latest
65

76
# [Optional] Uncomment this section to install additional packages.
87
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

.devcontainer/devcontainer.json

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/rust
33
{
4-
"name": "Rust",
5-
"build": {
6-
"dockerfile": "Dockerfile",
7-
"args": {
8-
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
9-
// Use bullseye when on local on arm64/Apple Silicon.
10-
"VARIANT": "buster"
11-
}
12-
},
13-
"runArgs": [
14-
"--cap-add=SYS_PTRACE",
15-
"--security-opt",
16-
"seccomp=unconfined"
17-
],
18-
// Configure tool-specific properties.
19-
"customizations": {
20-
// Configure properties specific to VS Code.
21-
"vscode": {
22-
// Set *default* container specific settings.json values on container create.
23-
"settings": {
24-
"lldb.executable": "/usr/bin/lldb",
25-
// VS Code don't watch files under ./target
26-
"files.watcherExclude": {
27-
"**/target/**": true
28-
},
29-
"rust-analyzer.checkOnSave.command": "clippy"
30-
},
31-
// Add the IDs of extensions you want installed when the container is created.
32-
"extensions": [
33-
"vadimcn.vscode-lldb",
34-
"mutantdino.resourcemonitor",
35-
"rust-lang.rust-analyzer",
36-
"bungcip.better-toml",
37-
"serayuzgur.crates"
38-
]
39-
}
40-
},
41-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
42-
// "forwardPorts": [],
43-
// Use 'postCreateCommand' to run commands after the container is created.
44-
// "postCreateCommand": "rustc --version",
45-
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
46-
"remoteUser": "vscode",
47-
"features": {
48-
"github-cli": "latest"
4+
"name": "Rust",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
9+
// Use bullseye when on local on arm64/Apple Silicon.
10+
"VARIANT": "buster"
4911
}
12+
},
13+
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
14+
// Configure tool-specific properties.
15+
"customizations": {
16+
// Configure properties specific to VS Code.
17+
"vscode": {
18+
// Set *default* container specific settings.json values on container create.
19+
"settings": {
20+
"lldb.executable": "/usr/bin/lldb",
21+
// VS Code don't watch files under ./target
22+
"files.watcherExclude": {
23+
"**/target/**": true
24+
},
25+
"rust-analyzer.checkOnSave.command": "clippy"
26+
},
27+
// Add the IDs of extensions you want installed when the container is created.
28+
"extensions": [
29+
"vadimcn.vscode-lldb",
30+
"mutantdino.resourcemonitor",
31+
"rust-lang.rust-analyzer",
32+
"bungcip.better-toml",
33+
"serayuzgur.crates"
34+
]
35+
}
36+
},
37+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
38+
// "forwardPorts": [],
39+
// Use 'postCreateCommand' to run commands after the container is created.
40+
// "postCreateCommand": "rustc --version",
41+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
42+
"remoteUser": "vscode",
43+
"features": {
44+
"github-cli": "latest"
45+
}
5046
}

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,34 @@ jobs:
4545
- name: Checkout repository
4646
uses: actions/checkout@v4
4747

48+
- name: Cache Cargo registry
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/.cargo/registry
53+
~/.cargo/git
54+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
55+
restore-keys: |
56+
${{ runner.os }}-cargo-registry-
57+
58+
- name: Cache Cargo build artifacts
59+
uses: actions/cache@v4
60+
with:
61+
path: target
62+
key: ${{ runner.os }}-target-${{ matrix.toolchain }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
63+
restore-keys: |
64+
${{ runner.os }}-target-${{ matrix.toolchain }}-${{ matrix.target }}-
65+
66+
- name: Cache Rustup toolchain
67+
uses: actions/cache@v4
68+
with:
69+
path: |
70+
~/.rustup
71+
~/.cargo/bin
72+
key: ${{ runner.os }}-rustup-${{ matrix.toolchain }}
73+
restore-keys: |
74+
${{ runner.os }}-rustup-
75+
4876
- name: Install Rust toolchain
4977
uses: actions-rs/toolchain@v1
5078
with:
@@ -80,6 +108,16 @@ jobs:
80108
- name: Checkout repository
81109
uses: actions/checkout@v4
82110

111+
- name: Cache Rustup toolchain
112+
uses: actions/cache@v4
113+
with:
114+
path: |
115+
~/.rustup
116+
~/.cargo/bin
117+
key: ubuntu-latest-rustup-stable
118+
restore-keys: |
119+
ubuntu-latest-rustup-
120+
83121
- name: Install Rust
84122
run: |
85123
rustup update stable

0 commit comments

Comments
 (0)