|
| 1 | +# |
| 2 | +# NOTE: this workflow is for testing the extension template itself, |
| 3 | +# this workflow will be removed when scripts/bootstrap-template.py is run |
| 4 | +# |
| 5 | +name: Extension Template |
| 6 | +on: [push, pull_request,repository_dispatch] |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }} |
| 9 | + cancel-in-progress: true |
| 10 | + |
| 11 | +jobs: |
| 12 | + linux: |
| 13 | + name: Linux |
| 14 | + if: ${{ vars.RUN_RENAME_TEST == 'true' || github.repository == 'duckdb/extension-template' }} |
| 15 | + runs-on: ubuntu-latest |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + # Add commits/tags to build against other DuckDB versions |
| 19 | + duckdb_version: [ '<submodule_version>' ] |
| 20 | + env: |
| 21 | + VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake |
| 22 | + VCPKG_TARGET_TRIPLET: 'x64-linux' |
| 23 | + GEN: ninja |
| 24 | + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true |
| 25 | + defaults: |
| 26 | + run: |
| 27 | + shell: bash |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Install Ninja |
| 31 | + shell: bash |
| 32 | + run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build |
| 33 | + |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + fetch-depth: 0 |
| 37 | + submodules: 'true' |
| 38 | + |
| 39 | + - name: Checkout DuckDB to version |
| 40 | + if: ${{ matrix.duckdb_version != '<submodule_version>'}} |
| 41 | + run: | |
| 42 | + cd duckdb |
| 43 | + git checkout ${{ matrix.duckdb_version }} |
| 44 | +
|
| 45 | + - name: Setup vcpkg |
| 46 | + uses: lukka/run-vcpkg@v11.1 |
| 47 | + with: |
| 48 | + vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b |
| 49 | + |
| 50 | + - name: Rename extension |
| 51 | + run: | |
| 52 | + python3 scripts/bootstrap-template.py ext_1_a_123b_b11 |
| 53 | +
|
| 54 | + - name: Build |
| 55 | + run: | |
| 56 | + make |
| 57 | +
|
| 58 | + - name: Test |
| 59 | + run: | |
| 60 | + make test |
| 61 | +
|
| 62 | + macos: |
| 63 | + name: MacOS |
| 64 | + if: ${{ vars.RUN_RENAME_TEST == 'true' || github.repository == 'duckdb/extension-template' }} |
| 65 | + runs-on: macos-latest |
| 66 | + strategy: |
| 67 | + matrix: |
| 68 | + # Add commits/tags to build against other DuckDB versions |
| 69 | + duckdb_version: [ '<submodule_version>'] |
| 70 | + env: |
| 71 | + VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake |
| 72 | + VCPKG_TARGET_TRIPLET: 'x64-osx' |
| 73 | + OSX_BUILD_ARCH: 'x86_64' |
| 74 | + GEN: ninja |
| 75 | + defaults: |
| 76 | + run: |
| 77 | + shell: bash |
| 78 | + |
| 79 | + steps: |
| 80 | + - uses: actions/checkout@v4 |
| 81 | + with: |
| 82 | + fetch-depth: 0 |
| 83 | + submodules: 'true' |
| 84 | + |
| 85 | + - name: Install Ninja |
| 86 | + run: brew install ninja |
| 87 | + |
| 88 | + - uses: actions/setup-python@v2 |
| 89 | + with: |
| 90 | + python-version: '3.11' |
| 91 | + |
| 92 | + - name: Checkout DuckDB to version |
| 93 | + if: ${{ matrix.duckdb_version != '<submodule_version>'}} |
| 94 | + run: | |
| 95 | + cd duckdb |
| 96 | + git checkout ${{ matrix.duckdb_version }} |
| 97 | +
|
| 98 | + - name: Setup vcpkg |
| 99 | + uses: lukka/run-vcpkg@v11.1 |
| 100 | + with: |
| 101 | + vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b |
| 102 | + |
| 103 | + - name: Rename extension |
| 104 | + run: | |
| 105 | + python scripts/bootstrap-template.py ext_1_a_123b_b11 |
| 106 | +
|
| 107 | + - name: Build |
| 108 | + run: | |
| 109 | + make |
| 110 | +
|
| 111 | + - name: Test |
| 112 | + run: | |
| 113 | + make test |
| 114 | +
|
| 115 | + windows: |
| 116 | + name: Windows |
| 117 | + if: ${{ vars.RUN_RENAME_TEST == 'true' || github.repository == 'duckdb/extension-template' }} |
| 118 | + runs-on: windows-latest |
| 119 | + strategy: |
| 120 | + matrix: |
| 121 | + # Add commits/tags to build against other DuckDB versions |
| 122 | + duckdb_version: [ '<submodule_version>' ] |
| 123 | + env: |
| 124 | + VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake |
| 125 | + VCPKG_TARGET_TRIPLET: 'x64-windows-static-md' |
| 126 | + defaults: |
| 127 | + run: |
| 128 | + shell: bash |
| 129 | + |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v4 |
| 132 | + with: |
| 133 | + fetch-depth: 0 |
| 134 | + submodules: 'true' |
| 135 | + |
| 136 | + - uses: actions/setup-python@v2 |
| 137 | + with: |
| 138 | + python-version: '3.11' |
| 139 | + |
| 140 | + - name: Checkout DuckDB to version |
| 141 | + # Add commits/tags to build against other DuckDB versions |
| 142 | + if: ${{ matrix.duckdb_version != '<submodule_version>'}} |
| 143 | + run: | |
| 144 | + cd duckdb |
| 145 | + git checkout ${{ matrix.duckdb_version }} |
| 146 | +
|
| 147 | + - name: Setup vcpkg |
| 148 | + uses: lukka/run-vcpkg@v11.1 |
| 149 | + with: |
| 150 | + vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b |
| 151 | + |
| 152 | + - name: Rename extension |
| 153 | + run: | |
| 154 | + python scripts/bootstrap-template.py ext_1_a_123b_b11 |
| 155 | +
|
| 156 | + - name: Build |
| 157 | + run: | |
| 158 | + make |
| 159 | +
|
| 160 | + - name: Test extension |
| 161 | + run: | |
| 162 | + build/release/test/Release/unittest.exe |
0 commit comments