From b17e1504faab4054e1b5a42bf3539e7f67f17391 Mon Sep 17 00:00:00 2001 From: Nick Hudson Date: Fri, 2 Jun 2023 12:17:29 -0500 Subject: [PATCH] updating tests, attempting to fix actions builder --- .github/CODEOWNERS | 1 + .github/workflows/trunk-build-publish.yaml | 8 +++++--- Cargo.toml | 2 +- src/lib.rs | 4 ++++ 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..22c88b9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @nhudson diff --git a/.github/workflows/trunk-build-publish.yaml b/.github/workflows/trunk-build-publish.yaml index 22a3cbc..3919080 100644 --- a/.github/workflows/trunk-build-publish.yaml +++ b/.github/workflows/trunk-build-publish.yaml @@ -34,9 +34,10 @@ jobs: test: name: Run tests + needs: lint runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Rust stable toolchain uses: actions-rs/toolchain@v1 with: @@ -56,9 +57,10 @@ jobs: # only publish off main branch if: github.ref == 'refs/heads/main' name: trunk publish + needs: test runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Rust stable toolchain uses: actions-rs/toolchain@v1 with: @@ -86,4 +88,4 @@ jobs: pgfs_ver=$(stoml Cargo.toml package.version) pgfs_descr=$(stoml Cargo.toml package.description) pgfs_repo=$(stoml Cargo.toml package.repository) - trunk publish pgfs --version ${pgfs_ver} --file .trunk/pgfs-${pgfs_ver}.tar.gz --description ${pgfs_descr} --homepage "https://github.com/CoreDB-io/pgfs" --repository "https://github.com/CoreDB-io/pgfs" --license "MIT" + trunk publish pgfs --version ${pgfs_ver} --file .trunk/pgfs-${pgfs_ver}.tar.gz --description ${pgfs_descr} --homepage "https://github.com/CoreDB-io/pgfs" --repository "https://github.com/CoreDB-io/pgfs" --license "MIT" \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 972e3cb..f2b7e4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "pgfs" version = "0.0.1" edition = "2021" authors = ["CoreDB.io"] -description = "Postgres extension to copy files from Postgres" +description = "Postgresql extension to help copy files on the file system using SQL" homepage = "https://www.coredb.io" license = "MIT" readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index 6065e26..30b75bd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,6 +90,10 @@ mod tests { }; assert_eq!(result, Some(true)); + // Assert to check if the src_file exists in the destination directory + let dest_file = format!("{}/test_file", dest_dir); + assert!(fs::metadata(dest_file).is_ok()); + // Clean up the directories let _ = fs::remove_dir_all(source_dir); let _ = fs::remove_dir_all(dest_dir);