Skip to content

Commit dc64377

Browse files
committed
ci: use devenv to install required deps
Signed-off-by: Ruowen Qin <ruowenq2@illinois.edu>
1 parent 24375f1 commit dc64377

File tree

5 files changed

+54
-41
lines changed

5 files changed

+54
-41
lines changed

.github/workflows/memcached_benchmark.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,23 @@ jobs:
2323

2424
steps:
2525
- uses: actions/checkout@v4
26+
- uses: cachix/install-nix-action@v26
27+
- uses: cachix/cachix-action@v14
28+
with:
29+
name: devenv
30+
- name: Install devenv.sh
31+
run: nix profile install nixpkgs#devenv
2632

27-
# Install Ubuntu dependencies
28-
- name: Install Ubuntu dependencies
29-
run: |
30-
sudo apt-get install -y pkg-config libzstd-dev mold binutils memcached
31-
sudo systemctl stop memcached
32-
wget https://apt.llvm.org/llvm.sh
33-
chmod +x llvm.sh
34-
sudo ./llvm.sh 19 all
35-
sudo update-alternatives --verbose --install /usr/bin/clang clang /usr/bin/clang-19 10000 \
36-
--slave /usr/bin/lld lld /usr/bin/lld-19 \
37-
--slave /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-19
33+
- name: Build the devenv shell and run any pre-commit hooks
34+
run: devenv test
3835

39-
- uses: actions-rust-lang/setup-rust-toolchain@v1
40-
with:
41-
components: rustfmt
42-
toolchain: stable
43-
- name: Rustfmt Check
44-
uses: actions-rust-lang/rustfmt@v1
45-
with:
46-
manifest-path: ./tools/memcached_benchmark/Cargo.toml
4736
- name: Build
48-
run: RUSTFLAGS='-Ctarget-cpu=native -Clinker-plugin-lto -Clink-arg=-flto=thin -Clink-arg=-fuse-ld=mold -Clink-arg=-Wl,-O1 -Clink-arg=-Wl,--as-needed' cargo build -vvv
49-
- name: Run tests with debug build
50-
run: RUSTFLAGS='-Ctarget-cpu=native -Clinker-plugin-lto -Clink-arg=-flto=thin -Clink-arg=-fuse-ld=mold -Clink-arg=-Wl,-O1 -Clink-arg=-Wl,--as-needed' cargo test --verbose
51-
- name: Run tests with release build
52-
run: RUSTFLAGS='-Ctarget-cpu=native -Clinker-plugin-lto -Clink-arg=-flto=thin -Clink-arg=-fuse-ld=mold -Clink-arg=-Wl,-O1 -Clink-arg=-Wl,--as-needed' cargo test -r --verbose
37+
shell: devenv shell bash -- -e {0}
38+
run: |
39+
cargo fmt --check --verbose
40+
cargo build -r --verbose
41+
- name: Run tests
42+
shell: devenv shell bash -- -e {0}
43+
run: |
44+
cargo test --verbose
45+
cargo test -r --verbose

tools/memcached_benchmark/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,23 @@ devenv.local.nix
99

1010
# pre-commit
1111
.pre-commit-config.yaml
12+
13+
# Devenv
14+
.devenv*
15+
devenv.local.nix
16+
17+
# direnv
18+
.direnv
19+
20+
# pre-commit
21+
.pre-commit-config.yaml
22+
23+
# Devenv
24+
.devenv*
25+
devenv.local.nix
26+
27+
# direnv
28+
.direnv
29+
30+
# pre-commit
31+
.pre-commit-config.yaml

tools/memcached_benchmark/devenv.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1741348424,
6+
"lastModified": 1743521698,
77
"owner": "cachix",
88
"repo": "devenv",
9-
"rev": "8f8c96bb1e0c6a59a97592328dc61b9fdbe7474b",
9+
"rev": "4917f16d045f12d938d0a29fb1cbfb9e24ae6d0d",
1010
"type": "github"
1111
},
1212
"original": {
@@ -24,10 +24,10 @@
2424
"rust-analyzer-src": "rust-analyzer-src"
2525
},
2626
"locked": {
27-
"lastModified": 1741501636,
27+
"lastModified": 1742452566,
2828
"owner": "nix-community",
2929
"repo": "fenix",
30-
"rev": "6781661e331d1efe11023d4a35f2dfe65272f248",
30+
"rev": "7d9ba794daf5e8cc7ee728859bc688d8e26d5f06",
3131
"type": "github"
3232
},
3333
"original": {
@@ -60,10 +60,10 @@
6060
]
6161
},
6262
"locked": {
63-
"lastModified": 1741379162,
63+
"lastModified": 1742649964,
6464
"owner": "cachix",
6565
"repo": "git-hooks.nix",
66-
"rev": "b5a62751225b2f62ff3147d0a334055ebadcd5cc",
66+
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
6767
"type": "github"
6868
},
6969
"original": {
@@ -94,16 +94,16 @@
9494
},
9595
"nixpkgs": {
9696
"locked": {
97-
"lastModified": 1733477122,
98-
"owner": "cachix",
99-
"repo": "devenv-nixpkgs",
100-
"rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857",
97+
"lastModified": 1743315132,
98+
"owner": "nixos",
99+
"repo": "nixpkgs",
100+
"rev": "52faf482a3889b7619003c0daec593a1912fddc1",
101101
"type": "github"
102102
},
103103
"original": {
104-
"owner": "cachix",
105-
"ref": "rolling",
106-
"repo": "devenv-nixpkgs",
104+
"owner": "nixos",
105+
"ref": "nixos-unstable",
106+
"repo": "nixpkgs",
107107
"type": "github"
108108
}
109109
},
@@ -121,10 +121,10 @@
121121
"rust-analyzer-src": {
122122
"flake": false,
123123
"locked": {
124-
"lastModified": 1741517882,
124+
"lastModified": 1743506973,
125125
"owner": "rust-lang",
126126
"repo": "rust-analyzer",
127-
"rev": "5e7dd31c80d5821113ed9c9aa1616a73a63b49a1",
127+
"rev": "c7845a6d70ea887e212ac6f682bea0a0e4fe245b",
128128
"type": "github"
129129
},
130130
"original": {

tools/memcached_benchmark/devenv.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
env.GREET = "devenv";
66

77
# https://devenv.sh/packages/
8-
packages = [ pkgs.git ];
8+
packages = with pkgs; [ git mold llvmPackages_20.clangUseLLVM memcached ];
99

1010
# https://devenv.sh/languages/
1111
languages.rust = {

tools/memcached_benchmark/devenv.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
inputs:
22
nixpkgs:
3-
url: github:cachix/devenv-nixpkgs/rolling
3+
url: github:nixos/nixpkgs/nixos-unstable
44
fenix:
55
url: github:nix-community/fenix
66
inputs:

0 commit comments

Comments
 (0)