refactor: Handling ffi errors correctly (#25) #50
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: Extension Build | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - "**.md" | |
| push: | |
| branches: | |
| - "main" | |
| paths-ignore: | |
| - "**.md" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| env: | |
| CUSTOM_LINKER: mold | |
| CCACHE_BASEDIR: ${{ github.workspace }} | |
| CCACHE_COMPRESS: "true" | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_MAXSIZE: 500M | |
| CCACHE_NOHASHDIR: "true" | |
| EXT_FLAGS: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Compute DuckDB SHA | |
| id: duckdb-sha | |
| run: | | |
| echo "sha=$(git -C duckdb rev-parse HEAD)" >> "$GITHUB_OUTPUT" | |
| - name: Compute Build SHA | |
| id: build-sha | |
| run: | | |
| echo "sha=${{ hashFiles('CMakeLists.txt', 'extension_config.cmake', 'Makefile') }}" >> "$GITHUB_OUTPUT" | |
| - name: Prepare cache directories | |
| run: | | |
| mkdir -p .ccache | |
| - name: Restore ccache | |
| id: cache-ccache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| .ccache | |
| key: ccache-${{ runner.os }}-${{ steps.duckdb-sha.outputs.sha }}-${{ steps.build-sha.outputs.sha }}-${{ github.sha }} | |
| restore-keys: | | |
| ccache-${{ runner.os }}-${{ steps.duckdb-sha.outputs.sha }}-${{ steps.build-sha.outputs.sha }}- | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y protobuf-compiler libssl-dev ninja-build ccache mold | |
| - name: Build | |
| run: | | |
| GEN=ninja make release -j 4 | |
| - name: Test | |
| run: | | |
| GEN=ninja make test | |
| - name: Save ccache | |
| if: github.ref == 'refs/heads/main' && success() | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| .ccache | |
| key: ccache-${{ runner.os }}-${{ steps.duckdb-sha.outputs.sha }}-${{ steps.build-sha.outputs.sha }}-${{ github.sha }} |