From d97bb0a7c346660d9166f1fd4583d8530677a14f Mon Sep 17 00:00:00 2001 From: morganamilo Date: Sun, 5 Nov 2023 10:02:15 +0000 Subject: [PATCH] Fix CI --- .github/workflows/paru.yml | 6 +++--- testdata/clone/devel/.SRCINFO | 2 -- testdata/clone/devel/PKGBUILD | 2 -- testdata/devel.toml | 2 +- tests/common/mod.rs | 5 +++-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/paru.yml b/.github/workflows/paru.yml index f9aab10b..107ae200 100644 --- a/.github/workflows/paru.yml +++ b/.github/workflows/paru.yml @@ -24,7 +24,7 @@ jobs: image: archlinux steps: - name: Install Packages - run: pacman -Syu rust clang gcc libarchive pkgconf sudo fakeroot --noconfirm --needed + run: pacman -Syu rust clang gcc git libarchive pkgconf sudo fakeroot --noconfirm --needed - name: Checkout uses: actions/checkout@v2 @@ -36,7 +36,7 @@ jobs: run: cargo build --locked --features generate - name: Test - run: sudo -u nobody BUILDDIR=/tmp PKGDEST=/tmp SRCDEST=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features generate,mock --target-dir=/tmp -- --test-threads=1 --nocapture + run: sudo -u nobody XDG_STATE_HOME=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features generate,mock --target-dir=/tmp -- --nocapture test-git: runs-on: ubuntu-latest @@ -65,4 +65,4 @@ jobs: run: cargo build --locked --features git,generate - name: Test - run: sudo -u nobody BUILDDIR=/tmp PKGDEST=/tmp SRCDEST=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features git,generate,mock --target-dir=/tmp -- --test-threads=1 --nocapture + run: sudo -u nobody XDG_STATE_HOME=/tmp CARGO_HOME=/tmp/cargo cargo test --locked --features git,generate,mock --target-dir=/tmp -- --nocapture diff --git a/testdata/clone/devel/.SRCINFO b/testdata/clone/devel/.SRCINFO index a2181ffa..54876fd3 100644 --- a/testdata/clone/devel/.SRCINFO +++ b/testdata/clone/devel/.SRCINFO @@ -2,7 +2,5 @@ pkgbase = devel pkgver = 1 pkgrel = 1 arch = any - source = git+file:////Users/morganamilo/git/paru/testdata/clone/devel/../../git-repo - sha256sums = SKIP pkgname = devel diff --git a/testdata/clone/devel/PKGBUILD b/testdata/clone/devel/PKGBUILD index 8fa1e434..7e6caf88 100644 --- a/testdata/clone/devel/PKGBUILD +++ b/testdata/clone/devel/PKGBUILD @@ -2,5 +2,3 @@ pkgname=devel pkgver=2 pkgrel=1 arch=(any) -source=(git+file:///$PWD/../../git-repo) -sha256sums=(SKIP) diff --git a/testdata/devel.toml b/testdata/devel.toml index 6e6f4864..c7181125 100644 --- a/testdata/devel.toml +++ b/testdata/devel.toml @@ -1,3 +1,3 @@ [[devel]] -url = "file:////Users/morganamilo/git/paru/testdata/clone/devel/../../git-repo" +url = "testdata/git-repo" commit = "deadbeef" diff --git a/tests/common/mod.rs b/tests/common/mod.rs index e1e7678f..30c4ffc9 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -59,7 +59,7 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> { } std::fs::create_dir_all(dir.join("cache/pkg"))?; - std::fs::create_dir_all(testdata.join("pkg"))?; + let _ = std::fs::create_dir_all(testdata.join("pkg")); let mut file = fs::OpenOptions::new() .append(true) @@ -181,9 +181,10 @@ async fn run(run_args: &[&str], repo: bool) -> Result<(TempDir, i32)> { for pkg in std::fs::read_dir(dir.join("cache/pkg"))? { let path = pkg?.path(); + let name = path.file_name().unwrap().to_str().unwrap(); if name.ends_with(".pkg.tar.zst") { - std::fs::rename(&path, testdata.join("pkg").join(name))?; + let _ = std::fs::rename(&path, testdata.join("pkg").join(name)); } }