diff --git a/.github/actions/linux-docker-release-verify/action.yml b/.github/actions/linux-docker-release-verify/action.yml new file mode 100644 index 00000000..972e39a7 --- /dev/null +++ b/.github/actions/linux-docker-release-verify/action.yml @@ -0,0 +1,33 @@ +name: docker-release-verify +author: martin +description: 'Linux release builds using docker' +inputs: + distro: # id of input + description: 'What distribution docker image to use' + required: true + default: 'ubuntu' + ruby: + description: 'What ruby version to use: system or latest' + required: true + default: 'latest' + test: + description: '1 if testing release workflow, 0 if actually releasing' + required: true + default: '1' + release: + description: 'Release version' + required: true + pre: + description: '1 if verifying pre-release,0 otherwise' + required: true + default: '0' + +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.distro }} + - ${{ inputs.ruby }} + - ${{ inputs.test }} + - ${{ inputs.release }} + - ${{ inputs.pre }} diff --git a/.github/actions/linux-docker-release-verify/entrypoint.sh b/.github/actions/linux-docker-release-verify/entrypoint.sh new file mode 100755 index 00000000..18cf376c --- /dev/null +++ b/.github/actions/linux-docker-release-verify/entrypoint.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +_distro=$1 +_ruby=$2 +_test=$3 +_release=$4 +_pre=$5 + +./tools/scripts/docker/setup-$_distro.sh test + +# Show some information about the system. +uname -a +locale +locale -a +cat /etc/os-release + +if [ "$_ruby" == "system" ]; then + # testing with system ruby + + ./tools/scripts/docker/setup-$_distro-system-ruby.sh + +else + # testing with latest ruby + + ./tools/scripts/docker/setup-ruby-install-latest.sh + +fi + +export __WXRUBY_RELEASE_VERSION=$_release +if [ "$_pre" == "1" ]; then + export __WXRUBY_PRERELEASE="--pre" +else + export __WXRUBY_PRERELEASE="" +fi + +if [ "$_test" == "1" ]; then + + ./tools/scripts/docker/test-wxruby3-release.sh --test + +else + + ./tools/scripts/docker/test-wxruby3-release.sh + +fi diff --git a/.github/actions/linux-docker-release/action.yml b/.github/actions/linux-docker-release/action.yml new file mode 100644 index 00000000..72ac19f8 --- /dev/null +++ b/.github/actions/linux-docker-release/action.yml @@ -0,0 +1,18 @@ +name: docker-release +author: martin +description: 'Linux release builds using docker' +inputs: + distro: # id of input + description: 'What distribution docker image to use' + required: true + default: 'ubuntu' + ruby: + description: 'What ruby version to use: system or latest' + required: false + default: 'latest' +runs: + using: 'docker' + image: 'Dockerfile' + args: + - ${{ inputs.distro }} + - ${{ inputs.ruby }} diff --git a/.github/actions/linux-docker-release/entrypoint.sh b/.github/actions/linux-docker-release/entrypoint.sh new file mode 100755 index 00000000..3ebddc55 --- /dev/null +++ b/.github/actions/linux-docker-release/entrypoint.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +distro=$1 +ruby=$2 + +./tools/scripts/docker/setup-$distro.sh + +# Show some information about the system. +uname -a +locale +locale -a +cat /etc/os-release + +if [ "$ruby" == "system" ]; then + # testing with system ruby + + ./tools/scripts/docker/setup-$distro-system-ruby.sh + + ./tools/scripts/docker/build-wxruby3.sh --binpkg 2>&1 | tee -a build-wxruby3.log + +else + # testing with latest ruby + + ./tools/scripts/docker/setup-ruby-install-latest.sh + + ./tools/scripts/docker/build-wxruby3.sh --latest --binpkg 2>&1 | tee -a build-wxruby3.log +fi diff --git a/.github/actions/linux-docker-verify/entrypoint.sh b/.github/actions/linux-docker-verify/entrypoint.sh index 5a43ccfe..d143d647 100755 --- a/.github/actions/linux-docker-verify/entrypoint.sh +++ b/.github/actions/linux-docker-verify/entrypoint.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -distro=$1 -ruby=$2 +_distro=$1 +_ruby=$2 export WXRUBY_TEST_EXCLUDE='test_intl:test_media_ctrl' -./tools/scripts/docker/setup-$distro.sh test +./tools/scripts/docker/setup-$_distro.sh test # Show some information about the system. uname -a @@ -13,10 +13,10 @@ locale locale -a cat /etc/os-release -if [ "$ruby" -eq "system" ]; then +if [ "$_ruby" -eq "system" ]; then # testing with system ruby - ./tools/scripts/docker/setup-$distro-system-ruby.sh + ./tools/scripts/docker/setup-$_distro-system-ruby.sh ./tools/scripts/docker/build-wxruby3.sh 2>&1 | tee -a build-wxruby3.log diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4f5a79de..0bafc736 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -47,37 +47,40 @@ jobs: - os: ubuntu-24.04 arch: x86_64 target_distro: fedora - target_base: fedora:latest + target_base: 'latest' target_ruby: system - os: ubuntu-24.04 arch: x86_64 target_distro: opensuse - target_base: 'opensuse/leap:latest' + target_docker_image: ['opensuse', 'leap'] + target_base: 'latest' target_ruby: system - os: ubuntu-24.04 arch: x86_64 target_distro: ubuntu - target_base: 'linuxmintd/mint22-amd64' + target_docker_image: ['linuxmintd', 'mint22.3-amd64'] + target_base: 'latest' target_ruby: system - os: ubuntu-24.04-arm arch: arm64 target_distro: debian - target_base: debian:12 + target_base: '12' target_ruby: system - os: ubuntu-24.04 arch: x86_64 target_distro: arch - target_base: 'archlinux/archlinux:latest' + target_docker_image: ['archlinux', 'archlinux'] + target_base: 'latest' target_ruby: latest runs-on: ${{ matrix.os }} - name: ${{ matrix.target_base }} ${{ matrix.arch }} ruby=${{ matrix.target_ruby }} + name: ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }}:${{ matrix.target_base }} ${{ matrix.arch }} ruby=${{ matrix.target_ruby }} steps: - name: Checkout wxRuby3 uses: actions/checkout@v6 - name: Setup Dockerfile run: | - ${{ github.workspace }}/tools/scripts/docker/create-docker-file.sh ${{ matrix.target_base }} ${{ github.workspace }}/.github/actions/linux-docker-verify/Dockerfile + ${{ github.workspace }}/tools/scripts/docker/create-docker-file.sh ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }} ${{ matrix.target_base }} ${{ github.workspace }}/.github/actions/linux-docker-verify/Dockerfile - name: Verify wxRuby3 on docker image uses: ./.github/actions/linux-docker-verify @@ -95,32 +98,34 @@ jobs: - os: ubuntu-24.04 arch: x86_64 target_distro: manjaro - target_base: 'manjarolinux/base:latest' + target_docker_image: ['manjarolinux', 'base'] + target_base: 'latest' target_ruby: system - os: ubuntu-24.04 arch: x86_64 target_distro: debian - target_base: debian:latest + target_base: 'latest' target_ruby: latest - os: ubuntu-24.04-arm arch: arm64 target_distro: fedora - target_base: fedora:42 + target_base: '42' target_ruby: latest - os: ubuntu-24.04-arm arch: arm64 target_distro: opensuse - target_base: 'opensuse/leap:15.6' + target_docker_image: ['opensuse', 'leap'] + target_base: '15.6' target_ruby: latest runs-on: ${{ matrix.os }} - name: ${{ matrix.target_base }} ${{ matrix.arch }} ruby=${{ matrix.target_ruby }} + name: ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }}:${{ matrix.target_base }} ${{ matrix.arch }} ruby=${{ matrix.target_ruby }} steps: - name: Checkout wxRuby3 uses: actions/checkout@v6 - name: Setup Dockerfile run: | - ${{ github.workspace }}/tools/scripts/docker/create-docker-file.sh ${{ matrix.target_base }} ${{ github.workspace }}/.github/actions/linux-docker-verify/Dockerfile + ${{ github.workspace }}/tools/scripts/docker/create-docker-file.sh ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }} ${{ matrix.target_base }} ${{ github.workspace }}/.github/actions/linux-docker-verify/Dockerfile - name: Verify wxRuby3 on docker image uses: ./.github/actions/linux-docker-verify diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17f46c5b..289e044b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: ruby: 'ruby' runs-on: ${{ matrix.os }} permissions: write-all - name: ${{ matrix.os }} wxRuby Release (${{ github.ref_name }}) + name: ${{ matrix.os }} wxRuby Release env: CIRRUS_TOKEN: ${{ secrets.CIRRUS_TOKEN }} outputs: @@ -82,14 +82,6 @@ jobs: overwrite: true file_glob: true - - name: Trigger Cirrus CI Release Tasks - run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - ruby tools/scripts/cirrus/start_release_tasks.rb "$GITHUB_REF_NAME" - else - ruby tools/scripts/cirrus/start_release_tasks.rb --release "$GITHUB_REF_NAME" - fi - - name: Upload Gem as release test artifact if: github.event_name == 'workflow_dispatch' uses: actions/upload-artifact@v7 @@ -108,11 +100,11 @@ jobs: echo "WXRUBY_PRERELEASE=0" >> "$GITHUB_OUTPUT" fi - release-windows-binpkg: + if: github.event_name != 'workflow_dispatch' needs: release-gem runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} wxRuby Binpkg Release (${{ github.ref_name }}) + name: binpkg ${{ matrix.os }} env: DOXYGEN_ROOT: ${{ github.workspace }}\doxygen strategy: @@ -210,7 +202,7 @@ jobs: release-macosx-binpkg: needs: release-gem runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} ${{ matrix.arch}} wxRuby Binpkg Release (${{ github.ref_name }}) + name: binpkg ${{ matrix.os }} ${{ matrix.arch}} (${{ github.ref_name }}) strategy: fail-fast: false matrix: @@ -292,6 +284,464 @@ jobs: name: wxruby3_release_test_bin_${{ matrix.name }} path: pkg/* + release-docker-binpkg: + needs: release-gem + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: debian + target_base: '13' + target_ruby: 'system' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: debian + target_base: '13' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: debian + target_base: '13' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: debian + target_base: '13' + target_ruby: 'latest' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: fedora + target_base: '44' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: fedora + target_base: '44' + target_ruby: 'system' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: ubuntu + target_base: '26.04' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_base: '26.04' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_docker_image: ['linuxmintd', 'mint22.3-amd64'] + target_base: 'latest' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_docker_image: ['linuxmintd', 'mint22.3-amd64'] + target_base: 'latest' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: opensuse + target_docker_image: ['opensuse', 'leap'] + target_base: '16.0' + target_ruby: 'latest' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: opensuse + target_docker_image: ['opensuse', 'leap'] + target_base: '16.0' + target_ruby: 'latest' + runs-on: ${{ matrix.os }} + name: binpkg ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }}:${{ matrix.target_base }} ${{ matrix.arch }} ruby=${{ matrix.target_ruby }} + steps: + - name: Checkout wxRuby3 + uses: actions/checkout@v6 + + - name: Setup Dockerfile + run: | + ${{ github.workspace }}/tools/scripts/docker/create-docker-file.sh ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }} ${{ matrix.target_base }} ${{ github.workspace }}/.github/actions/linux-docker-release/Dockerfile + + - name: Build wxRuby3 on docker image + uses: ./.github/actions/linux-docker-release + id: docker-release + with: + distro: ${{ matrix.target_distro }} + ruby: ${{ matrix.target_ruby }} + + - name: Upload bin pkg as release asset + if: github.event_name != 'workflow_dispatch' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: pkg/*.pkg + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + - name: Upload bin pkg digest signature as release asset + if: github.event_name != 'workflow_dispatch' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: pkg/*.sha + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + - name: Upload bin pkg as release test artifacts + if: github.event_name == 'workflow_dispatch' + uses: actions/upload-artifact@v7 + with: + name: wxruby3_release_test_bin_${{ matrix.arch }}_${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '_'), matrix.target_distro)}}_${{ matrix.target_base }}_${{ matrix.target_ruby}} + path: pkg/* + + verify-docker-gem: + needs: + - release-gem + - release-docker-binpkg + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: debian + target_base: '13' + target_ruby: 'system' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: debian + target_base: '13' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: debian + target_base: '13' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: debian + target_base: '13' + target_ruby: 'latest' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: fedora + target_base: '44' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: fedora + target_base: '44' + target_ruby: 'system' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: ubuntu + target_base: '26.04' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_base: '26.04' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_docker_image: ['linuxmintd', 'mint22.3-amd64'] + target_base: 'latest' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_docker_image: ['linuxmintd', 'mint22.3-amd64'] + target_base: 'latest' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: opensuse + target_docker_image: ['opensuse', 'leap'] + target_base: '16.0' + target_ruby: 'latest' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: opensuse + target_docker_image: ['opensuse', 'leap'] + target_base: '16.0' + target_ruby: 'latest' + runs-on: ${{ matrix.os }} + name: test ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }}:${{ matrix.target_base }} ${{ matrix.arch }} ruby=${{ matrix.target_ruby }} + env: + WXRUBY_RELEASE: ${{ needs.release-gem.outputs.version }} + WXRUBY_PRERELEASE: ${{ needs.release-gem.outputs.prerelease }} + steps: + - name: Checkout wxRuby3 + uses: actions/checkout@v6 + + - name: Download release test gem artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/download-artifact@v8 + with: + name: wxruby3_release_test_gem + + - name: Download bin pkg artifacts + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/download-artifact@v8 + with: + name: wxruby3_release_test_bin_${{ matrix.arch }}_${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '_'), matrix.target_distro)}}_${{ matrix.target_base }}_${{ matrix.target_ruby}} + + - name: Setup Dockerfile + run: | + ${{ github.workspace }}/tools/scripts/docker/create-docker-file.sh ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }} ${{ matrix.target_base }} ${{ github.workspace }}/.github/actions/linux-docker-release-verify/Dockerfile + + - name: Verify wxRuby3 on docker image + uses: ./.github/actions/linux-docker-release-verify + id: docker-release-verify + with: + distro: ${{ matrix.target_distro }} + ruby: ${{ matrix.target_ruby }} + test: ${{ case(github.event_name == 'workflow_dispatch', '1', '0') }} + release: ${{ env.WXRUBY_RELEASE }} + pre: ${{ env.WXRUBY_PRERELEASE }} + + release-docker-binpkg-prev-ver: + needs: release-docker-binpkg + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: debian + target_base: 12 + target_ruby: system + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: debian + target_base: 12 + target_ruby: latest + - os: ubuntu-24.04 + arch: x86_64 + target_distro: debian + target_base: 12 + target_ruby: system + - os: ubuntu-24.04 + arch: x86_64 + target_distro: debian + target_base: 12 + target_ruby: latest + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: fedora + target_base: '43' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: fedora + target_base: '43' + target_ruby: 'system' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: fedora + target_base: '43' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: fedora + target_base: '43' + target_ruby: 'latest' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: ubuntu + target_base: '24.04' + target_ruby: 'system' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: ubuntu + target_base: '24.04' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_base: '24.04' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_base: '24.04' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: opensuse + target_docker_image: ['opensuse', 'leap'] + target_base: '15.6' + target_ruby: 'latest' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: opensuse + target_docker_image: ['opensuse', 'leap'] + target_base: '15.6' + target_ruby: 'latest' + runs-on: ${{ matrix.os }} + name: binpkg ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }}:${{ matrix.target_base }} ${{ matrix.arch }} ruby=${{ matrix.target_ruby }} + steps: + - name: Checkout wxRuby3 + uses: actions/checkout@v6 + + - name: Setup Dockerfile + run: | + ${{ github.workspace }}/tools/scripts/docker/create-docker-file.sh ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }} ${{ matrix.target_base }} ${{ github.workspace }}/.github/actions/linux-docker-release/Dockerfile + + - name: Build wxRuby3 on docker image + uses: ./.github/actions/linux-docker-release + id: docker-release + with: + distro: ${{ matrix.target_distro }} + ruby: ${{ matrix.target_ruby }} + + - name: Upload bin pkg as release asset + if: github.event_name != 'workflow_dispatch' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: pkg/*.pkg + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + - name: Upload bin pkg digest signature as release asset + if: github.event_name != 'workflow_dispatch' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: pkg/*.sha + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + - name: Upload bin pkg as release test artifacts + if: github.event_name == 'workflow_dispatch' + uses: actions/upload-artifact@v7 + with: + name: wxruby3_release_test_bin_${{ matrix.arch }}_${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '_'), matrix.target_distro)}}_${{ matrix.target_base }}_${{ matrix.target_ruby}} + path: pkg/* + + verify-docker-gem-prev-ver: + needs: + - release-gem + - release-docker-binpkg-prev-ver + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: debian + target_base: 12 + target_ruby: system + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: debian + target_base: 12 + target_ruby: latest + - os: ubuntu-24.04 + arch: x86_64 + target_distro: debian + target_base: 12 + target_ruby: system + - os: ubuntu-24.04 + arch: x86_64 + target_distro: debian + target_base: 12 + target_ruby: latest + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: fedora + target_base: '43' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: fedora + target_base: '43' + target_ruby: 'system' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: fedora + target_base: '43' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: fedora + target_base: '43' + target_ruby: 'latest' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: ubuntu + target_base: '24.04' + target_ruby: 'system' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: ubuntu + target_base: '24.04' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_base: '24.04' + target_ruby: 'system' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: ubuntu + target_base: '24.04' + target_ruby: 'latest' + - os: ubuntu-24.04 + arch: x86_64 + target_distro: opensuse + target_docker_image: ['opensuse', 'leap'] + target_base: '15.6' + target_ruby: 'latest' + - os: ubuntu-24.04-arm + arch: arm64 + target_distro: opensuse + target_docker_image: ['opensuse', 'leap'] + target_base: '15.6' + target_ruby: 'latest' + runs-on: ${{ matrix.os }} + name: test ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }}:${{ matrix.target_base }} ${{ matrix.arch }} ruby=${{ matrix.target_ruby }} + env: + WXRUBY_RELEASE: ${{ needs.release-gem.outputs.version }} + WXRUBY_PRERELEASE: ${{ needs.release-gem.outputs.prerelease }} + steps: + - name: Checkout wxRuby3 + uses: actions/checkout@v6 + + - name: Download release test gem artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/download-artifact@v8 + with: + name: wxruby3_release_test_gem + + - name: Download bin pkg artifacts + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/download-artifact@v8 + with: + name: wxruby3_release_test_bin_${{ matrix.arch }}_${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '_'), matrix.target_distro)}}_${{ matrix.target_base }}_${{ matrix.target_ruby}} + + - name: Setup Dockerfile + run: | + ${{ github.workspace }}/tools/scripts/docker/create-docker-file.sh ${{ case(matrix.target_docker_image != '', join(matrix.target_docker_image, '/'), matrix.target_distro) }} ${{ matrix.target_base }} ${{ github.workspace }}/.github/actions/linux-docker-release-verify/Dockerfile + + - name: Verify wxRuby3 on docker image + uses: ./.github/actions/linux-docker-release-verify + id: docker-release-verify + with: + distro: ${{ matrix.target_distro }} + ruby: ${{ matrix.target_ruby }} + test: ${{ case(github.event_name == 'workflow_dispatch', '1', '0') }} + release: ${{ env.WXRUBY_RELEASE }} + pre: ${{ env.WXRUBY_PRERELEASE }} + verify-gem: needs: - release-gem @@ -349,7 +799,7 @@ jobs: build: false runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} wxRuby Gem Test (${{ github.ref_name }}) + name: test ${{ matrix.os }} wxRuby Gem Test (${{ github.ref_name }}) env: WXWIDGETS_ROOT: ${{ github.workspace }}/ext/wxWidgets WXWIDGETS_LATEST_STABLE: ${{ vars.WXWIDGETS_LATEST_STABLE }} @@ -515,12 +965,14 @@ jobs: run: | wxruby test + verify-gem-windows: + if: github.event_name != 'workflow_dispatch' needs: - release-gem - release-windows-binpkg runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} wxRuby Gem Test (${{ github.ref_name }}) + name: test ${{ matrix.os }} wxRuby Gem Test (${{ github.ref_name }}) env: WXRUBY_RELEASE: ${{ needs.release-gem.outputs.version }} WXRUBY_PRERELEASE: ${{ needs.release-gem.outputs.prerelease }} diff --git a/lib/wx/doc/stream.rb b/lib/wx/doc/stream.rb index aaf27054..93ba295a 100644 --- a/lib/wx/doc/stream.rb +++ b/lib/wx/doc/stream.rb @@ -17,12 +17,16 @@ class InputStream # Reads bytes from stream and writes these to output stream until eof or error. # @param [IO,Wx::OutputStream] output output stream to write to # @return [self] - def read(*args); end + def read(*); end + # @overload read_all(size) # Reads size bytes from stream (until eof or error). # @param [Integer] size number of bytes to read # @return [String,nil] string with bytes read (nil if none read) - def read_all(size); end + # @overload read_all() + # Reads all bytes from stream (until eof or error). + # @return [String,nil] string with bytes read (nil if none read) + def read_all(*); end end @@ -36,7 +40,7 @@ class OutputStream # Write bytes read from input stream (until eof or error) # @param [IO,Wx::InputStream] input input stream to read from # @return [self] - def write(*args); end + def write(*); end # Writes bytes from buffer to stream. # @param [String] buffer string with bytes to write diff --git a/lib/wx/wxruby/cmd/test.rb b/lib/wx/wxruby/cmd/test.rb index 0f37b03a..1658363a 100644 --- a/lib/wx/wxruby/cmd/test.rb +++ b/lib/wx/wxruby/cmd/test.rb @@ -38,7 +38,8 @@ def self.parse_args(args) exit(0) end opts.on('--exclude=TEST', - "exclude the specified test from running") {|v| Test.options[:excludes] << v } + "Exclude the specified test from running") {|v| Test.options[:excludes] << v } + opts.on('--keep-going', 'Do NOT stop on error.') { Test.options[:keep_going] = true } opts.on('-h', '--help', 'Show this message.') do |v| puts opts @@ -66,9 +67,14 @@ def self.run(argv) end end tests.each do |test| + rc = true unless Test.options[:excludes].include?(File.basename(test, '.*')) - exit(1) unless system(RUBY, test) + $stdout.puts + $stdout.puts "Running #{File.basename(test, '.*')} ..." + rc &&= system(RUBY, test) + exit(1) unless rc || Test.options[:keep_going] end + exit(1) unless rc end end end diff --git a/rakelib/lib/config/pkgman/linux.rb b/rakelib/lib/config/pkgman/linux.rb index 71195a3d..34b656e6 100644 --- a/rakelib/lib/config/pkgman/linux.rb +++ b/rakelib/lib/config/pkgman/linux.rb @@ -43,9 +43,11 @@ def get(distro, release: nil) end PLATFORM_DEPS = { - debian: PlatformDependencies.new(%w[libgtk-3-dev libwebkit2gtk-4.0-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev]) - .add('debian', %w[libgtk-3-dev libwebkit2gtk-4.1-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev], release: '13') + debian: PlatformDependencies.new(%w[libgtk-3-dev libwebkit2gtk-4.[0-9]+-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev]) + .add('debian', %w[libgtk-3-dev libwebkit2gtk-4.1-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev], release: '12') + .alias('debian', '12', 'debian', '13') .add('ubuntu', %w[libgtk-3-dev libwebkit2gtk-4.1-dev libgspell-1-dev libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev], release: '24.04') + .alias('ubuntu', '24.04', 'ubuntu', '26.04') .alias('ubuntu', '24.04', 'linuxmint', '22') .alias('ubuntu', '24.04', 'linuxmint', '22.1') .alias('ubuntu', '24.04', 'linuxmint', '22.2') diff --git a/rakelib/lib/director/editable_listbox.rb b/rakelib/lib/director/editable_listbox.rb index ae846b27..e2998a8e 100644 --- a/rakelib/lib/director/editable_listbox.rb +++ b/rakelib/lib/director/editable_listbox.rb @@ -16,14 +16,16 @@ class EditableListBox < Window def setup super - # methods missing from docs - spec.extend_interface 'wxEditableListBox', - 'wxListCtrl* GetListCtrl()', - 'wxBitmapButton* GetDelButton()', - 'wxBitmapButton* GetNewButton()', - 'wxBitmapButton* GetUpButton()', - 'wxBitmapButton* GetDownButton()', - 'wxBitmapButton* GetEditButton()' + if Config.instance.wx_version_check('3.3.3') < 0 + # methods missing from docs + spec.extend_interface 'wxEditableListBox', + 'wxListCtrl* GetListCtrl()', + 'wxBitmapButton* GetDelButton()', + 'wxBitmapButton* GetNewButton()', + 'wxBitmapButton* GetUpButton()', + 'wxBitmapButton* GetDownButton()', + 'wxBitmapButton* GetEditButton()' + end # redefine this spec.ignore 'wxEditableListBox::GetStrings', ignore_doc: false spec.add_extend_code 'wxEditableListBox', <<~__HEREDOC diff --git a/rakelib/lib/director/fs_file.rb b/rakelib/lib/director/fs_file.rb index 52d9342b..c5f597d3 100644 --- a/rakelib/lib/director/fs_file.rb +++ b/rakelib/lib/director/fs_file.rb @@ -86,6 +86,29 @@ def setup return nread>0 ? rb_str_new(buffer.get(), nread) : Qnil; } __HEREDOC + if Config.instance.wx_version_check('3.3.3') >= 0 + # covered by custom ReadAll() + spec.ignore 'wxInputStream::Read(std::vector &)' + spec.add_extend_code 'wxInputStream', <<~__HEREDOC + VALUE ReadAll() + { + std::vector buffer; + $self->Read(buffer); + return buffer.size()>0 ? rb_str_new(reinterpret_cast (buffer.data()), buffer.size()) : Qnil; + } + __HEREDOC + else + spec.include 'wx/mstream.h' + spec.add_extend_code 'wxInputStream', <<~__HEREDOC + VALUE ReadAll() + { + wxMemoryOutputStream stream; + $self->Read(stream); + wxStreamBuffer* buffer = stream.GetOutputStreamBuffer(); + return buffer->GetBufferSize()>0 ? rb_str_new(reinterpret_cast (buffer->GetBufferStart()), buffer->GetBufferSize()) : Qnil; + } + __HEREDOC + end # for Read(wxOutputStream&) spec.map 'wxInputStream&' => 'Wx::InputStream' do map_out code: '$result = self; wxUnusedVar($1);' diff --git a/tests/test_webview.rb b/tests/test_webview.rb index 4db2649f..668e4dc4 100644 --- a/tests/test_webview.rb +++ b/tests/test_webview.rb @@ -85,10 +85,10 @@ def test_load_url yield_and_wait_for_test(5000) { loaded} # unfortunately the WebView2 loader on windows is flaky in CI builds and tends to fail (too often) # so just skip the test in such cases - if loaded || !(is_msw? && is_ci_build? && Wx::WEB::WEBVIEW_BACKEND_DEFAULT == Wx::WEB::WEBVIEW_BACKEND_EDGE) + if loaded || !is_ci_build? assert_true(loaded) else - STDERR.puts 'WARNING: Skipping test because of WebView2 load failure' + STDERR.puts 'WARNING: Skipping test because CI' end end @@ -400,12 +400,12 @@ def test_load_net_url frame_win.evt_webview_loaded(webview) { |_| loaded = true } webview.load_url('https://mcorino.github.io/wxRuby3/') yield_and_wait_for_test(10000) { loaded} - # unfortunately the WebView2 loader on windows is flaky in CI builds and tends to fail (too often) + # unfortunately WebView loader is flaky in CI builds and tends to fail (too often) # so just skip the test in such cases - if loaded || !(is_msw? && is_ci_build? && Wx::WEB::WEBVIEW_BACKEND_DEFAULT == Wx::WEB::WEBVIEW_BACKEND_EDGE) + if loaded || !is_ci_build? assert_true(loaded) else - STDERR.puts 'WARNING: Skipping test because of WebView2 load failure' + STDERR.puts 'WARNING: Skipping test because of CI' end end diff --git a/tools/scripts/docker/build-wxruby3.sh b/tools/scripts/docker/build-wxruby3.sh index f66d6508..a002ce1d 100755 --- a/tools/scripts/docker/build-wxruby3.sh +++ b/tools/scripts/docker/build-wxruby3.sh @@ -18,14 +18,12 @@ case $a in esac done -if [ "$latest_only" == "" ] || [ "$_ruby" == "latest" ]; then - ruby -v +ruby -v - bundle install - bundle exec rake 'configure[--with-wxwin,--autoinstall]' - bundle exec rake build +bundle install +bundle exec rake 'configure[--with-wxwin,--autoinstall]' +bundle exec rake build - if [ "$_binpkg" == "1" ]; then - bundle exec rake binpkg - fi +if [ "$_binpkg" == "1" ]; then + bundle exec rake binpkg fi diff --git a/tools/scripts/docker/create-docker-file.sh b/tools/scripts/docker/create-docker-file.sh index 0dada096..3f6b1704 100755 --- a/tools/scripts/docker/create-docker-file.sh +++ b/tools/scripts/docker/create-docker-file.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -cat << EOF > $2 -FROM $1 +cat << EOF > $3 +FROM $1:$2 LABEL authors="martin" COPY entrypoint.sh /entrypoint.sh diff --git a/tools/scripts/docker/setup-debian-system-ruby.sh b/tools/scripts/docker/setup-debian-system-ruby.sh index 56dba9a5..632f7c53 100755 --- a/tools/scripts/docker/setup-debian-system-ruby.sh +++ b/tools/scripts/docker/setup-debian-system-ruby.sh @@ -3,5 +3,5 @@ if [ "$1" == "remove" ]; then apt-get remove -y ruby ruby-dev else - apt-get install -y ruby ruby-dev ruby-bundler + apt-get install -y ruby ruby-dev ruby-bundler openssl libssl-dev fi diff --git a/tools/scripts/docker/setup-fedora-system-ruby.sh b/tools/scripts/docker/setup-fedora-system-ruby.sh index f2a0e65b..6bf26e3f 100755 --- a/tools/scripts/docker/setup-fedora-system-ruby.sh +++ b/tools/scripts/docker/setup-fedora-system-ruby.sh @@ -3,5 +3,5 @@ if [ "$1" == "remove" ]; then dnf remove -y ruby ruby-devel else - dnf install -y ruby ruby-devel rubygem-bundler + dnf install -y ruby ruby-devel rubygem-bundler openssl openssl-devel fi diff --git a/tools/scripts/docker/setup-ubuntu-system-ruby.sh b/tools/scripts/docker/setup-ubuntu-system-ruby.sh index 56dba9a5..632f7c53 100755 --- a/tools/scripts/docker/setup-ubuntu-system-ruby.sh +++ b/tools/scripts/docker/setup-ubuntu-system-ruby.sh @@ -3,5 +3,5 @@ if [ "$1" == "remove" ]; then apt-get remove -y ruby ruby-dev else - apt-get install -y ruby ruby-dev ruby-bundler + apt-get install -y ruby ruby-dev ruby-bundler openssl libssl-dev fi diff --git a/tools/scripts/docker/setup-ubuntu.sh b/tools/scripts/docker/setup-ubuntu.sh index 867b3ace..9734feda 100755 --- a/tools/scripts/docker/setup-ubuntu.sh +++ b/tools/scripts/docker/setup-ubuntu.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash apt-get update -apt-get install -y git make gcc gpg xvfb xfonts-75dpi curl procps +apt-get install -y git make gcc gpg xvfb xfonts-75dpi curl procps bzip2 if [ "$1" == "test" ]; then source /etc/os-release case $VERSION_ID in - 24.04) + 24.04|26.04) apt-get install -y 'libgtk-3-[0-9]+' 'libwebkit2gtk-4.1-[0-9]+' 'libgspell-1-[0-9]+' libnotify4 'libsecret-1-[0-9]+' curl ;; *) diff --git a/tools/scripts/docker/test-wxruby3-release.sh b/tools/scripts/docker/test-wxruby3-release.sh index 3c7b54c7..5da3789c 100755 --- a/tools/scripts/docker/test-wxruby3-release.sh +++ b/tools/scripts/docker/test-wxruby3-release.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -_ruby="system" +_test=0 for a in "$@" do case $a in - --latest) - _ruby="latest" + --test) + _test=1 ;; *) # unknown option @@ -14,31 +14,14 @@ case $a in esac done -if [ "$latest_only" == "" ] || [ "$_ruby" == "latest" ]; then +echo "Testing wxRuby3 v$__WXRUBY_RELEASE_VERSION" - if [ "$CIRRUS_TAG" == "" ]; then - CIRRUS_TAG=$(ruby tools/scripts/cirrus/get_release_tag.rb) - rc=$? - if [ "$rc" != "0" ]; then - echo "$CIRRUS_TAG" - exit $rc - fi - fi +if [ "$_test" == "1" ]; then - echo "Testing wxRuby3 $CIRRUS_TAG" + gem install ./$(echo wxruby3*.gem) --no-format-executable -- package=`pwd`/$(echo wxruby3*.pkg) && xvfb-run -a -s '-screen 0 1600x1200x24' wxruby test --keep-going --exclude=test_intl --exclude=test_media_ctrl +else gem sources --add "https://mcorino:$GITHUB_TOKEN@rubygems.pkg.github.com/mcorino/" - WXRUBY_VERSION=${CIRRUS_TAG/#v/} - if grep -q "\-[a-zA-Z]" <<< "$CIRRUS_TAG" ; then - WXRUBY_PRERELEASE="--pre" - else - WXRUBY_PRERELEASE="" - fi - if [ "$distro" == "macosx" ]; then - gem install wxruby3 -v "$WXRUBY_VERSION" ${WXRUBY_PRERELEASE} --no-format-executable && wxruby test --exclude=test_intl --exclude=test_media_ctrl - else - gem install wxruby3 -v "$WXRUBY_VERSION" ${WXRUBY_PRERELEASE} --no-format-executable && xvfb-run -a -s '-screen 0 1600x1200x24' wxruby test --exclude=test_intl --exclude=test_media_ctrl - fi - + gem install wxruby3 -v "${__WXRUBY_RELEASE_VERSION}" ${__WXRUBY_PRERELEASE} --no-format-executable && xvfb-run -a -s '-screen 0 1600x1200x24' wxruby test --keep-going --exclude=test_intl --exclude=test_media_ctrl fi