A fork of attic a self-hostable Nix Binary Cache server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #167 from zhaofengli/rustfmt

rustfmt

authored by

Zhaofeng Li and committed by
GitHub
bea72d75 f74cee00

+66 -6
.cargo/config .cargo/config.toml
+44
.github/workflows/lint.yml
··· 1 + name: Lint 2 + 3 + on: 4 + pull_request: 5 + push: 6 + jobs: 7 + lint: 8 + name: Lint 9 + 10 + runs-on: ubuntu-latest 11 + 12 + steps: 13 + - uses: actions/checkout@v4.1.1 14 + 15 + - uses: DeterminateSystems/nix-installer-action@v9 16 + continue-on-error: true # Self-hosted runners already have Nix installed 17 + 18 + - name: Install Attic 19 + run: | 20 + if ! command -v attic &> /dev/null; then 21 + ./.github/install-attic-ci.sh 22 + fi 23 + 24 + - name: Configure Attic 25 + run: | 26 + : "${ATTIC_SERVER:=https://staging.attic.rs/}" 27 + : "${ATTIC_CACHE:=attic-ci}" 28 + echo ATTIC_CACHE=$ATTIC_CACHE >>$GITHUB_ENV 29 + export PATH=$HOME/.nix-profile/bin:$PATH # FIXME 30 + attic login --set-default ci "$ATTIC_SERVER" "$ATTIC_TOKEN" 31 + attic use "$ATTIC_CACHE" 32 + env: 33 + ATTIC_SERVER: ${{ secrets.ATTIC_SERVER }} 34 + ATTIC_CACHE: ${{ secrets.ATTIC_CACHE }} 35 + ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }} 36 + 37 + - name: Cache dev shell 38 + run: | 39 + .ci/cache-shell.sh 40 + system=$(nix-instantiate --eval -E 'builtins.currentSystem') 41 + echo system=$system >>$GITHUB_ENV 42 + 43 + - name: Check rustfmt 44 + run: .ci/run just ci-rustfmt
+16 -4
attic/src/stream.rs
··· 190 190 // force multiple reads 191 191 let mut buf = vec![0u8; 100]; 192 192 let mut bytes_read = 0; 193 - bytes_read += read.read(&mut buf[bytes_read..bytes_read + 5]).await.unwrap(); 194 - bytes_read += read.read(&mut buf[bytes_read..bytes_read + 5]).await.unwrap(); 195 - bytes_read += read.read(&mut buf[bytes_read..bytes_read + 5]).await.unwrap(); 196 - bytes_read += read.read(&mut buf[bytes_read..bytes_read + 5]).await.unwrap(); 193 + bytes_read += read 194 + .read(&mut buf[bytes_read..bytes_read + 5]) 195 + .await 196 + .unwrap(); 197 + bytes_read += read 198 + .read(&mut buf[bytes_read..bytes_read + 5]) 199 + .await 200 + .unwrap(); 201 + bytes_read += read 202 + .read(&mut buf[bytes_read..bytes_read + 5]) 203 + .await 204 + .unwrap(); 205 + bytes_read += read 206 + .read(&mut buf[bytes_read..bytes_read + 5]) 207 + .await 208 + .unwrap(); 197 209 198 210 assert_eq!(expected.len(), bytes_read); 199 211 assert_eq!(expected, &buf[..bytes_read]);
+1 -1
attic/src/testing/mod.rs
··· 24 24 } 25 25 26 26 data 27 - } 27 + }
+1 -1
client/src/cache.rs
··· 14 14 use anyhow::{anyhow, Result}; 15 15 use serde::{Deserialize, Serialize}; 16 16 17 - pub use attic::cache::{CacheName}; 17 + pub use attic::cache::CacheName; 18 18 19 19 /// A reference to a cache. 20 20 #[derive(Debug, Clone)]
+4
justfile
··· 41 41 system=$(nix-instantiate --eval -E 'builtins.currentSystem') 42 42 tests=$(nix build .#internalMatrix."$system".\"{{ matrix }}\".attic-tests --no-link --print-out-paths -L) 43 43 find "$tests/bin" -exec {} \; 44 + 45 + # (CI) Run rustfmt check 46 + ci-rustfmt: 47 + cargo fmt --check