From 568a3109d94fdfcce1fae5b35f961875ff375e33 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 15:39:33 +0700 Subject: [PATCH 01/29] ci: add test for windows and macos --- .github/workflows/main.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 667b17db..e838600b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -62,6 +62,7 @@ jobs: runs-on: windows-latest env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" steps: @@ -74,14 +75,17 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq run: vcpkg install libpq[core]:x64-windows-release - - name: Build - run: cargo build --locked --target x86_64-pc-windows-msvc + - name: Build and test + run: cargo test --locked --target x86_64-pc-windows-msvc # TODO: setup postgres instance for testing build-macos: runs-on: macos-latest + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + steps: - uses: actions/checkout@v4 - - name: Build - run: cargo build --locked --target x86_64-apple-darwin + - name: Build and test + run: cargo test --locked --target x86_64-apple-darwin From 9fcad7811e4d6b6de7670c23ea16c28dbb030d43 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 17:05:28 +0700 Subject: [PATCH 02/29] build libpq static --- .github/workflows/main.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e838600b..d7503bde 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -57,7 +57,6 @@ jobs: - name: Build and test run: ${{ matrix.platform.command }} test --locked --target ${{ matrix.platform.target }} - # TODO: setup postgres instance for testing build-windows: runs-on: windows-latest @@ -74,11 +73,10 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq - run: vcpkg install libpq[core]:x64-windows-release + run: vcpkg install libpq[core]:x64-windows-release-static - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc - # TODO: setup postgres instance for testing build-macos: runs-on: macos-latest From 60f1fe89e6357dab1dae1c90cc49e9b9983da424 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 17:08:21 +0700 Subject: [PATCH 03/29] correct triplet static release --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d7503bde..eba44fd6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -73,7 +73,7 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq - run: vcpkg install libpq[core]:x64-windows-release-static + run: vcpkg install libpq[core]:x64-windows-static-release - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From 2c75dba787d2624b8b98190d9422582088ada8d2 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 21:39:38 +0700 Subject: [PATCH 04/29] use choco to install postgres --- .github/workflows/main.yaml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index eba44fd6..d56c75f8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,20 +15,16 @@ jobs: fail-fast: false matrix: platform: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu + - target: x86_64-unknown-linux-gnu command: cargo - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu + - target: aarch64-unknown-linux-gnu command: cross - - os: ubuntu-latest - target: x86_64-unknown-linux-musl + - target: x86_64-unknown-linux-musl command: cross - - os: ubuntu-latest - target: aarch64-unknown-linux-musl + - target: aarch64-unknown-linux-musl command: cross - runs-on: ${{ matrix.platform.os }} + runs-on: ubuntu-latest env: DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" @@ -62,18 +58,13 @@ jobs: env: DATABASE_URL: ${{ secrets.DATABASE_URL }} - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" steps: - uses: actions/checkout@v4 - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v6 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Install libpq - run: vcpkg install libpq[core]:x64-windows-static-release + - name: Install postgres + run: | + choco install postgresql16 --force --params '/Password:root' + echo "PQ_LIB_DIR=C:\Program Files\PostgreSQL\16\lib" >> $GITHUB_ENV - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From c816b437d9d952be31b66889566a463303cead4e Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 22:03:07 +0700 Subject: [PATCH 05/29] export postgres path --- .github/workflows/main.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d56c75f8..688509f2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -64,6 +64,8 @@ jobs: - name: Install postgres run: | choco install postgresql16 --force --params '/Password:root' + echo "C:\Program Files\PostgreSQL\16\bin" >> $GITHUB_PATH + echo "C:\Program Files\PostgreSQL\16\lib" >> $GITHUB_PATH echo "PQ_LIB_DIR=C:\Program Files\PostgreSQL\16\lib" >> $GITHUB_ENV - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From e3522c67db3dea26db155e595d7c7f7a14d396a9 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 22:31:43 +0700 Subject: [PATCH 06/29] use vcpkg --- .github/workflows/main.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 688509f2..68bdc2b5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -58,15 +58,22 @@ jobs: env: DATABASE_URL: ${{ secrets.DATABASE_URL }} + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" steps: - uses: actions/checkout@v4 - - name: Install postgres + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v6 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Install libpq run: | - choco install postgresql16 --force --params '/Password:root' - echo "C:\Program Files\PostgreSQL\16\bin" >> $GITHUB_PATH - echo "C:\Program Files\PostgreSQL\16\lib" >> $GITHUB_PATH - echo "PQ_LIB_DIR=C:\Program Files\PostgreSQL\16\lib" >> $GITHUB_ENV + vcpkg install libpq[core]:x64-windows-static-release + echo "C:\vcpkg\installed\x64-windows\bin" >> $GITHUB_PATH + echo "C:\vcpkg\installed\x64-windows\lib" >> $GITHUB_PATH + echo "PQ_LIB_DIR=C:\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From c52746de621bd24e6c0045df5bb3cd93b7269d70 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 22:39:22 +0700 Subject: [PATCH 07/29] use d for vcpkg --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 68bdc2b5..77362f83 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,9 +71,9 @@ jobs: - name: Install libpq run: | vcpkg install libpq[core]:x64-windows-static-release - echo "C:\vcpkg\installed\x64-windows\bin" >> $GITHUB_PATH - echo "C:\vcpkg\installed\x64-windows\lib" >> $GITHUB_PATH - echo "PQ_LIB_DIR=C:\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV + echo "D:\Thirdparty\vcpkg\installed\x64-windows\bin" >> $GITHUB_PATH + echo "D:\Thirdparty\vcpkg\installed\x64-windows\lib" >> $GITHUB_PATH + echo "PQ_LIB_DIR=D:\Thirdparty\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From 66055a59262e867340eba584c8e34ac52b98b270 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 22:44:32 +0700 Subject: [PATCH 08/29] check --- .github/workflows/main.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 77362f83..7f040f3b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -74,6 +74,11 @@ jobs: echo "D:\Thirdparty\vcpkg\installed\x64-windows\bin" >> $GITHUB_PATH echo "D:\Thirdparty\vcpkg\installed\x64-windows\lib" >> $GITHUB_PATH echo "PQ_LIB_DIR=D:\Thirdparty\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV + - name: Check + run: | + printenv + ls "D:\Thirdparty\vcpkg\installed\x64-windows\bin" + ls "D:\Thirdparty\vcpkg\installed\x64-windows\lib" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From 6defe7385246202c2e47053b416464f741c50c0b Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 22:48:27 +0700 Subject: [PATCH 09/29] check --- .github/workflows/main.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7f040f3b..fe84bd16 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,14 +71,15 @@ jobs: - name: Install libpq run: | vcpkg install libpq[core]:x64-windows-static-release - echo "D:\Thirdparty\vcpkg\installed\x64-windows\bin" >> $GITHUB_PATH - echo "D:\Thirdparty\vcpkg\installed\x64-windows\lib" >> $GITHUB_PATH - echo "PQ_LIB_DIR=D:\Thirdparty\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV + echo "$VCPKG_INSTALLATION_ROOT\installed\x64-windows\bin" >> $GITHUB_PATH + echo "$VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" >> $GITHUB_PATH + echo "PQ_LIB_DIR=$VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" >> $GITHUB_ENV - name: Check run: | printenv - ls "D:\Thirdparty\vcpkg\installed\x64-windows\bin" - ls "D:\Thirdparty\vcpkg\installed\x64-windows\lib" + ls "$VCPKG_INSTALLATION_ROOT\installed\" + ls "$VCPKG_INSTALLATION_ROOT\installed\x64-windows\bin" + ls "$VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From 230f18d69f2388f24bdac639a5d68f67d7f912ee Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 22:56:21 +0700 Subject: [PATCH 10/29] check --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fe84bd16..889abb61 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -77,9 +77,9 @@ jobs: - name: Check run: | printenv - ls "$VCPKG_INSTALLATION_ROOT\installed\" - ls "$VCPKG_INSTALLATION_ROOT\installed\x64-windows\bin" - ls "$VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" + ls "C:\vcpkg\installed\" + ls "C:\vcpkg\installed\x64-windows\bin" + ls "C:\vcpkg\installed\x64-windows\lib" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From b90bfc9c1d85afaf5b53ef0eb6d9003f6d65e43f Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 22:58:57 +0700 Subject: [PATCH 11/29] check --- .github/workflows/main.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 889abb61..72e3a4b9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,15 +71,15 @@ jobs: - name: Install libpq run: | vcpkg install libpq[core]:x64-windows-static-release - echo "$VCPKG_INSTALLATION_ROOT\installed\x64-windows\bin" >> $GITHUB_PATH - echo "$VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" >> $GITHUB_PATH - echo "PQ_LIB_DIR=$VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" >> $GITHUB_ENV + echo "$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\bin" >> $GITHUB_PATH + echo "$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib" >> $GITHUB_PATH + echo "PQ_LIB_DIR=$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib" >> $GITHUB_ENV - name: Check run: | printenv ls "C:\vcpkg\installed\" - ls "C:\vcpkg\installed\x64-windows\bin" - ls "C:\vcpkg\installed\x64-windows\lib" + ls "C:\vcpkg\installed\x64-windows-static-release\bin" + ls "C:\vcpkg\installed\x64-windows-static-release\lib" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From 6665b985d5f5fe6a7d5ea5e4f47040aadb7e3566 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:01:39 +0700 Subject: [PATCH 12/29] check --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 72e3a4b9..721cdd74 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -78,7 +78,7 @@ jobs: run: | printenv ls "C:\vcpkg\installed\" - ls "C:\vcpkg\installed\x64-windows-static-release\bin" + ls "C:\vcpkg\installed\x64-windows-static-release\" ls "C:\vcpkg\installed\x64-windows-static-release\lib" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From 4fb198e4f67b7851f1716e16cbddbefd84c84626 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:14:06 +0700 Subject: [PATCH 13/29] export path --- .github/workflows/main.yaml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 721cdd74..118cbcb2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -69,19 +69,12 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq - run: | - vcpkg install libpq[core]:x64-windows-static-release - echo "$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\bin" >> $GITHUB_PATH - echo "$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib" >> $GITHUB_PATH - echo "PQ_LIB_DIR=$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib" >> $GITHUB_ENV - - name: Check - run: | - printenv - ls "C:\vcpkg\installed\" - ls "C:\vcpkg\installed\x64-windows-static-release\" - ls "C:\vcpkg\installed\x64-windows-static-release\lib" + run: vcpkg install libpq[core]:x64-windows-static-release - name: Build and test - run: cargo test --locked --target x86_64-pc-windows-msvc + run: | + export PATH=$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib:$PATH + export PQ_LIB_DIR=$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib + cargo test --locked --target x86_64-pc-windows-msvc build-macos: runs-on: macos-latest From 4d99bad23af5a92736c7b26e8b8ad3ddf9f6c029 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:23:23 +0700 Subject: [PATCH 14/29] copy --- .github/workflows/main.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 118cbcb2..f00bfbec 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -72,8 +72,7 @@ jobs: run: vcpkg install libpq[core]:x64-windows-static-release - name: Build and test run: | - export PATH=$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib:$PATH - export PQ_LIB_DIR=$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib + cp "$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib\libpq.lib" "$HOME\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\" cargo test --locked --target x86_64-pc-windows-msvc build-macos: From cd132dddd9867ccb75b5a9540f606f1fff4235c5 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:25:51 +0700 Subject: [PATCH 15/29] copy --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f00bfbec..b2e45fb5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -69,11 +69,11 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq - run: vcpkg install libpq[core]:x64-windows-static-release - - name: Build and test run: | + vcpkg install libpq[core]:x64-windows-static-release cp "$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib\libpq.lib" "$HOME\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\" - cargo test --locked --target x86_64-pc-windows-msvc + - name: Build and test + run: cargo test --locked --target x86_64-pc-windows-msvc build-macos: runs-on: macos-latest From b6683d66517c36fa2b8270d7715714b7d6164f72 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:28:14 +0700 Subject: [PATCH 16/29] copy --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b2e45fb5..5e8a4540 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,7 +71,7 @@ jobs: - name: Install libpq run: | vcpkg install libpq[core]:x64-windows-static-release - cp "$VCPKG_INSTALLATION_ROOT\installed\x64-windows-static-release\lib\libpq.lib" "$HOME\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\" + cp "C:\vcpkg\installed\x64-windows-static-release\lib\libpq.lib" "$HOME\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From 096e4ff83f934cf53ae59ce88a8077e819b98a6c Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:33:39 +0700 Subject: [PATCH 17/29] copy --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5e8a4540..2588b518 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,7 +71,7 @@ jobs: - name: Install libpq run: | vcpkg install libpq[core]:x64-windows-static-release - cp "C:\vcpkg\installed\x64-windows-static-release\lib\libpq.lib" "$HOME\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\" + cp "C:\vcpkg\installed\x64-windows-static-release\lib\libpq.lib" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From a51c04bb75dad9d5d5257e0721d7671913531eb1 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:35:57 +0700 Subject: [PATCH 18/29] copy --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2588b518..bf2b6f90 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,7 +71,7 @@ jobs: - name: Install libpq run: | vcpkg install libpq[core]:x64-windows-static-release - cp "C:\vcpkg\installed\x64-windows-static-release\lib\libpq.lib" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\" + cp "C:\vcpkg\installed\x64-windows-static-release\lib\libpq.lib" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From 3bbed12e0e4c15643eb87081443217a2d85aff4f Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:42:43 +0700 Subject: [PATCH 19/29] copy --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bf2b6f90..7c10783d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,7 +71,7 @@ jobs: - name: Install libpq run: | vcpkg install libpq[core]:x64-windows-static-release - cp "C:\vcpkg\installed\x64-windows-static-release\lib\libpq.lib" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + cp "C:\vcpkg\installed\x64-windows-static-release\lib\*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc From e646a11336fe62ea976806d3141baf7d78e96e30 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Mon, 22 Jan 2024 23:48:46 +0700 Subject: [PATCH 20/29] ls --- .github/workflows/main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7c10783d..bafe04f9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -73,7 +73,9 @@ jobs: vcpkg install libpq[core]:x64-windows-static-release cp "C:\vcpkg\installed\x64-windows-static-release\lib\*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - name: Build and test - run: cargo test --locked --target x86_64-pc-windows-msvc + run: | + ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + cargo test --locked --target x86_64-pc-windows-msvc build-macos: runs-on: macos-latest From 83055fdc26f985623c7aaa263cedbf04fc2c4174 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:00:52 +0700 Subject: [PATCH 21/29] copy --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bafe04f9..4fd17612 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -71,7 +71,7 @@ jobs: - name: Install libpq run: | vcpkg install libpq[core]:x64-windows-static-release - cp "C:\vcpkg\installed\x64-windows-static-release\lib\*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + cp "$VCPKG_INSTALLATION_ROOT/installed/x64-windows-static-release/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - name: Build and test run: | ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" From 6ea729ac7c00c8d4e6ec999341f9127d95e2e957 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:03:44 +0700 Subject: [PATCH 22/29] copy --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4fd17612..5e37ba5c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -70,8 +70,8 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq run: | - vcpkg install libpq[core]:x64-windows-static-release - cp "$VCPKG_INSTALLATION_ROOT/installed/x64-windows-static-release/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + vcpkg install libpq[core]:x64-windows-static-md-release + cp "C:/vcpkg/installed/x64-windows-static-md-release/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - name: Build and test run: | ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" From 310bffce92fe56129c30d8418c9f189ea092844d Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:05:49 +0700 Subject: [PATCH 23/29] md --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5e37ba5c..83d6c693 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -70,8 +70,8 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq run: | - vcpkg install libpq[core]:x64-windows-static-md-release - cp "C:/vcpkg/installed/x64-windows-static-md-release/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + vcpkg install libpq[core]:x64-windows-static-md + cp "C:/vcpkg/installed/x64-windows-static-md/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - name: Build and test run: | ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" From c9014f277f15aff5237ecad3efe1c11d7ee89a43 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:08:46 +0700 Subject: [PATCH 24/29] not core --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 83d6c693..218494cb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -70,7 +70,7 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq run: | - vcpkg install libpq[core]:x64-windows-static-md + vcpkg install libpq:x64-windows-static-md cp "C:/vcpkg/installed/x64-windows-static-md/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - name: Build and test run: | From eda0d51fdccffc614c3813a3c044a0b72f99ba8b Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:18:02 +0700 Subject: [PATCH 25/29] release --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 218494cb..bb853ceb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -70,8 +70,8 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq run: | - vcpkg install libpq:x64-windows-static-md - cp "C:/vcpkg/installed/x64-windows-static-md/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + vcpkg install libpq:x64-windows-static-release + cp "C:/vcpkg/installed/x64-windows-static-release/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - name: Build and test run: | ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" From d6c828ac01dbc90f7792526aa56c93e909bc3c29 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:18:32 +0700 Subject: [PATCH 26/29] not static --- .github/workflows/main.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bb853ceb..21101ed8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -70,11 +70,13 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq run: | - vcpkg install libpq:x64-windows-static-release - cp "C:/vcpkg/installed/x64-windows-static-release/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + vcpkg install libpq:x64-windows-release + cp "C:/vcpkg/installed/x64-windows-release/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + cp "C:/vcpkg/installed/x64-windows-release/bin/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\" - name: Build and test run: | ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" + ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\" cargo test --locked --target x86_64-pc-windows-msvc build-macos: From 55e2ebab356c8765117b1987c42f397d3ce282b4 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:30:04 +0700 Subject: [PATCH 27/29] core release dynamic --- .github/workflows/main.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 21101ed8..fd597342 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -70,14 +70,11 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libpq run: | - vcpkg install libpq:x64-windows-release - cp "C:/vcpkg/installed/x64-windows-release/lib/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - cp "C:/vcpkg/installed/x64-windows-release/bin/*" "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\" + vcpkg install libpq[core]:x64-windows-release + cp "C:/vcpkg/installed/x64-windows-release/lib/*" "C:/Users/runneradmin/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/lib/" + cp "C:/vcpkg/installed/x64-windows-release/bin/*" "C:/Users/runneradmin/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/bin/" - name: Build and test - run: | - ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\" - ls "C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\" - cargo test --locked --target x86_64-pc-windows-msvc + run: cargo test --locked --target x86_64-pc-windows-msvc build-macos: runs-on: macos-latest From 69619015c43a0f891305284ee28fd45f0743b389 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:33:27 +0700 Subject: [PATCH 28/29] setup postgres locally --- .github/workflows/main.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fd597342..8cba2616 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -57,11 +57,12 @@ jobs: runs-on: windows-latest env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" steps: - uses: actions/checkout@v4 + - uses: ikalnytskyi/action-setup-postgres@v5 + id: postgres - name: Export GitHub Actions cache environment variables uses: actions/github-script@v6 with: @@ -75,14 +76,17 @@ jobs: cp "C:/vcpkg/installed/x64-windows-release/bin/*" "C:/Users/runneradmin/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/bin/" - name: Build and test run: cargo test --locked --target x86_64-pc-windows-msvc + env: + DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }} build-macos: runs-on: macos-latest - env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} - steps: - uses: actions/checkout@v4 + - uses: ikalnytskyi/action-setup-postgres@v5 + id: postgres - name: Build and test run: cargo test --locked --target x86_64-apple-darwin + env: + DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }} From fcdc9edd89adc786bd846bfa6f0b08faa5739693 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Tue, 23 Jan 2024 00:42:19 +0700 Subject: [PATCH 29/29] less strict error message for windows --- src/utils/fs/folders.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/utils/fs/folders.rs b/src/utils/fs/folders.rs index 04b72638..b86589fb 100644 --- a/src/utils/fs/folders.rs +++ b/src/utils/fs/folders.rs @@ -120,7 +120,7 @@ mod tests { .unwrap() .downcast_ref::() .unwrap() - .contains("No such file or directory")); + .contains("NotFound")); } #[tokio::test] @@ -137,10 +137,7 @@ mod tests { .unwrap() .downcast_ref::() .unwrap() - .contains(&concat_string!( - &file.to_string_lossy(), - " is not a directory" - ))); + .contains("is not a directory")); } #[tokio::test]