From f4aa2d41dc822ebaac62bd5866e92d04ac9aa42f Mon Sep 17 00:00:00 2001 From: Sam Ansmink Date: Tue, 2 Jul 2024 15:50:00 +0200 Subject: [PATCH 1/2] remove workflow duplication --- .github/workflows/_extension_distribution.yml | 397 ------------------ .github/workflows/build.yml | 7 +- .github/workflows/deploy.yml | 3 +- 3 files changed, 6 insertions(+), 401 deletions(-) delete mode 100644 .github/workflows/_extension_distribution.yml diff --git a/.github/workflows/_extension_distribution.yml b/.github/workflows/_extension_distribution.yml deleted file mode 100644 index 39cb113..0000000 --- a/.github/workflows/_extension_distribution.yml +++ /dev/null @@ -1,397 +0,0 @@ -# Reusable workflow for building DuckDB extensions using a standardized environment -# -# The workflow: -# - builds the extension using the CI workflow from the corresponding DuckDB version -# - uploads the extensions as gh actions artifacts in the following format: -# --extension- -# -# note: extensions are simply uploaded to GitHub actions, deploying the extensions is done a separate step. More info on -# this can be found in https://github.com/duckdb/extension-template - -name: Extension distribution -on: - workflow_call: - inputs: - # The name with which the extension will be built - extension_name: - required: true - type: string - # DuckDB version to build against, should in most cases be identical to - duckdb_version: - required: true - type: string - # ';' separated list of architectures to exclude, for example: 'linux_amd64;osx_arm64' - exclude_archs: - required: false - type: string - default: "" - # Postfix added to artifact names. Can be used to guarantee unique names when this workflow is called multiple times - artifact_postfix: - required: false - type: string - default: "" - # Override the default vcpkg commit used by this version of DuckDB - vcpkg_commit: - required: false - type: string - default: "a1a1cbc975abf909a6c8985a6a2b8fe20bbd9bd6" - # Override the default script producing the matrices. Allows specifying custom matrices. - matrix_parse_script: - required: false - type: string - default: "./duckdb/scripts/modify_distribution_matrix.py" - # Enable building the DuckDB Shell - build_duckdb_shell: - required: false - type: boolean - default: true - repository: - required: false - type: string - default: "" - ref: - required: false - type: string - default: "" -jobs: - generate_matrix: - name: Generate matrix - runs-on: ubuntu-latest - outputs: - linux_matrix: ${{ steps.set-matrix-linux.outputs.linux_matrix }} - windows_matrix: ${{ steps.set-matrix-windows.outputs.windows_matrix }} - osx_matrix: ${{ steps.set-matrix-osx.outputs.osx_matrix }} - wasm_matrix: ${{ steps.set-matrix-wasm.outputs.wasm_matrix }} - steps: - - uses: actions/checkout@v3 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - fetch-depth: 0 - submodules: 'true' - - - name: Checkout DuckDB to version - run: | - cd duckdb - git checkout ${{ inputs.duckdb_version }} - - - id: parse-matrices - run: | - python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --select_os linux --output linux_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty - python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --select_os osx --output osx_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty - python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --select_os windows --output windows_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty - python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --select_os wasm --output wasm_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty - - - id: set-matrix-linux - run: | - linux_matrix="`cat linux_matrix.json`" - echo linux_matrix=$linux_matrix >> $GITHUB_OUTPUT - echo `cat $GITHUB_OUTPUT` - - - id: set-matrix-osx - run: | - osx_matrix="`cat osx_matrix.json`" - echo osx_matrix=$osx_matrix >> $GITHUB_OUTPUT - echo `cat $GITHUB_OUTPUT` - - - id: set-matrix-windows - run: | - windows_matrix="`cat windows_matrix.json`" - echo windows_matrix=$windows_matrix >> $GITHUB_OUTPUT - echo `cat $GITHUB_OUTPUT` - - - id: set-matrix-wasm - run: | - wasm_matrix="`cat wasm_matrix.json`" - echo wasm_matrix=$wasm_matrix >> $GITHUB_OUTPUT - echo `cat $GITHUB_OUTPUT` - - linux: - name: Linux - runs-on: ubuntu-latest - container: ${{ matrix.container }} - needs: generate_matrix - if: ${{ needs.generate_matrix.outputs.linux_matrix != '{}' && needs.generate_matrix.outputs.linux_matrix != '' }} - strategy: - matrix: ${{fromJson(needs.generate_matrix.outputs.linux_matrix)}} - env: - VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet }} - VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - GEN: Ninja - BUILD_SHELL: ${{ inputs.build_duckdb_shell && '1' || '0' }} - DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} - - steps: - - name: Install required ubuntu packages - if: ${{ matrix.duckdb_arch == 'linux_amd64' || matrix.duckdb_arch == 'linux_arm64' }} - run: | - apt-get update -y -qq - apt-get install -y -qq software-properties-common - add-apt-repository ppa:git-core/ppa - apt-get update -y -qq - apt-get install -y -qq --fix-missing ninja-build make gcc-multilib g++-multilib libssl-dev wget openjdk-8-jdk zip maven unixodbc-dev libc6-dev-i386 lib32readline6-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip build-essential checkinstall libffi-dev curl libz-dev openssh-client - - - name: Install Git 2.18.5 - if: ${{ matrix.duckdb_arch == 'linux_amd64' || matrix.duckdb_arch == 'linux_arm64' }} - run: | - wget https://github.com/git/git/archive/refs/tags/v2.18.5.tar.gz - tar xvf v2.18.5.tar.gz - cd git-2.18.5 - make - make prefix=/usr install - git --version - - - uses: actions/checkout@v3 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - fetch-depth: 0 - submodules: 'true' - - - name: Checkout DuckDB to version - run: | - cd duckdb - git checkout ${{ inputs.duckdb_version }} - - - name: Setup ManyLinux2014 - if: ${{ matrix.duckdb_arch == 'linux_amd64_gcc4' }} - run: | - ./duckdb/scripts/setup_manylinux2014.sh general aws-cli ccache ssh python_alias openssl - - - name: Setup Ubuntu - if: ${{ matrix.duckdb_arch == 'linux_amd64' || matrix.duckdb_arch == 'linux_arm64' }} - uses: ./duckdb/.github/actions/ubuntu_18_setup - with: - aarch64_cross_compile: ${{ matrix.duckdb_arch == 'linux_arm64' && 1 }} - - - uses: actions/checkout@v3 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - fetch-depth: 0 - submodules: 'true' - - - name: Checkout DuckDB to version - run: | - cd duckdb - git checkout ${{ inputs.duckdb_version }} - - - name: Setup Ccache - uses: hendrikmuhs/ccache-action@v1.2.11 # Note: pinned due to GLIBC incompatibility in later releases - continue-on-error: true - with: - key: ${{ github.job }}-${{ matrix.duckdb_arch }} - - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11.1 - with: - vcpkgGitCommitId: ${{ inputs.vcpkg_commit }} - - - name: Build extension - env: - GEN: ninja - CC: ${{ matrix.duckdb_arch == 'linux_arm64' && 'aarch64-linux-gnu-gcc' || '' }} - CXX: ${{ matrix.duckdb_arch == 'linux_arm64' && 'aarch64-linux-gnu-g++' || '' }} - DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} - run: | - make release - - - name: Test extension - if: ${{ matrix.duckdb_arch != 'linux_arm64'}} - run: | - make test - - - uses: actions/upload-artifact@v2 - with: - name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}} - path: | - build/release/extension/${{ inputs.extension_name }}/${{ inputs.extension_name }}.duckdb_extension - - macos: - name: MacOS - runs-on: macos-latest - needs: generate_matrix - if: ${{ needs.generate_matrix.outputs.osx_matrix != '{}' && needs.generate_matrix.outputs.osx_matrix != '' }} - strategy: - matrix: ${{fromJson(needs.generate_matrix.outputs.osx_matrix)}} - env: - VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet }} - OSX_BUILD_ARCH: ${{ matrix.osx_build_arch }} - GEN: Ninja - BUILD_SHELL: ${{ inputs.build_duckdb_shell && '1' || '0' }} - DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} - - steps: - - uses: actions/checkout@v3 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - fetch-depth: 0 - submodules: 'true' - - - name: Install Ninja - run: | - brew install ninja - - - name: Setup Ccache - uses: hendrikmuhs/ccache-action@main - continue-on-error: true - with: - key: ${{ github.job }}-${{ matrix.duckdb_arch }} - - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Checkout DuckDB to version - run: | - cd duckdb - git checkout ${{ inputs.duckdb_version }} - - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11.1 - with: - vcpkgGitCommitId: ${{ inputs.vcpkg_commit }} - - - name: Build extension - shell: bash - env: - DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} - run: | - make release - - - name: Test Extension - if: ${{ matrix.osx_build_arch == 'x86_64'}} - shell: bash - run: | - make test - - - uses: actions/upload-artifact@v3 - with: - if-no-files-found: error - name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}} - path: | - build/release/extension/${{ inputs.extension_name }}/${{ inputs.extension_name }}.duckdb_extension - - windows: - name: Windows - runs-on: windows-latest - needs: generate_matrix - if: ${{ needs.generate_matrix.outputs.windows_matrix != '{}' && needs.generate_matrix.outputs.windows_matrix != '' }} - strategy: - matrix: ${{fromJson(needs.generate_matrix.outputs.windows_matrix)}} - env: - VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet }} - BUILD_SHELL: ${{ inputs.build_duckdb_shell && '1' || '0' }} - DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} - CC: ${{ matrix.duckdb_arch == 'windows_amd64_rtools' && 'gcc' || '' }} - CXX: ${{ matrix.duckdb_arch == 'windows_amd64_rtools' && 'g++' || '' }} - - steps: - - name: Keep \n line endings - shell: bash - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - uses: actions/checkout@v3 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - fetch-depth: 0 - submodules: 'true' - - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - uses: r-lib/actions/setup-r@v2 - if: matrix.duckdb_arch == 'windows_amd64_rtools' - with: - r-version: 'devel' - update-rtools: true - rtools-version: '42' # linker bug in 43 - - - name: Checkout DuckDB to version - run: | - cd duckdb - git checkout ${{ inputs.duckdb_version }} - - - name: Setup Ccache - uses: hendrikmuhs/ccache-action@main - continue-on-error: true - with: - key: ${{ github.job }}-${{ matrix.duckdb_arch }} - - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11.1 - with: - vcpkgGitCommitId: ${{ inputs.vcpkg_commit }} - - - name: Build & test extension - env: - DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} - DUCKDB_PLATFORM_RTOOLS: ${{ matrix.duckdb_arch == 'windows_amd64_rtools' && 1 || 0 }} - run: | - make test_release - - - uses: actions/upload-artifact@v3 - with: - if-no-files-found: error - name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}} - path: | - build/release/extension/${{ inputs.extension_name }}/${{ inputs.extension_name }}.duckdb_extension - - wasm: - name: DuckDB-Wasm - runs-on: ubuntu-latest - needs: generate_matrix - if: ${{ needs.generate_matrix.outputs.wasm_matrix != '{}' && needs.generate_matrix.outputs.wasm_matrix != '' }} - strategy: - matrix: ${{fromJson(needs.generate_matrix.outputs.wasm_matrix)}} - env: - VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet }} - VCPKG_TOOLCHAIN_PATH: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - GEN: Ninja - DUCKDB_PLATFORM: ${{ matrix.duckdb_arch }} - - steps: - - uses: actions/checkout@v3 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - fetch-depth: 0 - submodules: 'true' - - - name: Checkout DuckDB to version - run: | - cd duckdb - git checkout ${{ inputs.duckdb_version }} - - - uses: mymindstorm/setup-emsdk@v13 - with: - version: 'latest' - - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11.1 - with: - vcpkgGitCommitId: ${{ inputs.vcpkg_commit }} - - - name: Setup Ccache - uses: hendrikmuhs/ccache-action@main - continue-on-error: true - with: - key: ${{ github.job }}-${{ matrix.duckdb_arch }} - - - name: Build Wasm module - run: | - make ${{ matrix.duckdb_arch }} - - - uses: actions/upload-artifact@v3 - with: - if-no-files-found: error - name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}} - path: | - build/${{ matrix.duckdb_arch }}/extension/${{ inputs.extension_name }}/${{ inputs.extension_name }}.duckdb_extension.wasm \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1f7117..1973e04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,14 +40,15 @@ jobs: build: needs: prepare - uses: ./.github/workflows/_extension_distribution.yml + uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.0.0 if: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME != '' }} with: duckdb_version: v1.0.0 + enable_rust: true exclude_archs: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_EXCLUDE_PLATFORMS }} extension_name: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_NAME }} - repository: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_GITHUB }} - ref: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_REF }} + override_repository: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_GITHUB }} + override_ref: ${{ needs.prepare.outputs.COMMUNITY_EXTENSION_REF }} doc_test: needs: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6afab6f..496bd72 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,11 +31,12 @@ jobs: build: needs: prepare - uses: ./.github/workflows/_extension_distribution.yml + uses: samansmink/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.0.0 strategy: matrix: ${{fromJson(needs.prepare.outputs.matrix)}} with: duckdb_version: v1.0.0 + enable_rust: true extension_name: ${{ matrix.COMMUNITY_EXTENSION_NAME }} exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools' repository: ${{ matrix.COMMUNITY_EXTENSION_GITHUB }} From c611a66c8097046ea022a73cdce88a207c420b86 Mon Sep 17 00:00:00 2001 From: Sam Ansmink Date: Tue, 2 Jul 2024 15:54:03 +0200 Subject: [PATCH 2/2] fix copy-paste error --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 496bd72..b3e88de 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,7 +31,7 @@ jobs: build: needs: prepare - uses: samansmink/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.0.0 + uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.0.0 strategy: matrix: ${{fromJson(needs.prepare.outputs.matrix)}} with: