perf: avoid per-chunk byte[] copy in CryptifyClient.StoreChunkAsync (… #44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Continuous integration | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 10.0.x | |
| # Download pre-built native library for CI | |
| - name: Download pg-ffi native library | |
| run: | | |
| TAG=$(gh release list --repo encryption4all/postguard --json tagName -q '[.[] | select(.tagName | startswith("pg-ffi-"))][0].tagName' 2>/dev/null || true) | |
| if [ -n "$TAG" ]; then | |
| mkdir -p src/runtimes/linux-x64/native | |
| gh release download "$TAG" --repo encryption4all/postguard --pattern "pg-ffi-linux-x64.tar.gz" --dir /tmp | |
| tar xzf /tmp/pg-ffi-linux-x64.tar.gz -C src/runtimes/linux-x64/native | |
| else | |
| echo "::warning::No pg-ffi release found. Building from source." | |
| rustup default stable | |
| git clone --depth 1 https://github.com/encryption4all/postguard.git /tmp/postguard | |
| cargo build --release -p pg-ffi --manifest-path /tmp/postguard/Cargo.toml | |
| mkdir -p src/runtimes/linux-x64/native | |
| cp /tmp/postguard/target/release/libpg_ffi.so src/runtimes/linux-x64/native/ | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build | |
| run: dotnet build E4A.PostGuard.slnx --configuration Release | |
| - name: Pack (dry run) | |
| run: dotnet pack src/E4A.PostGuard.csproj --configuration Release --no-build --output ./artifacts | |
| - name: Upload package artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: nuget-package | |
| path: ./artifacts/*.nupkg | |
| retention-days: 7 |