diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2c2963..adff631 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,5 @@ +# This file is generated. Please edit publish-images.yml.erb instead! + name: CI concurrency: group: "${{github.workflow}}-${{github.ref}}" @@ -16,7 +18,788 @@ on: branches: - "*" -jobs: +jobs: + + aarch64-linux-musl: + name: "build aarch64-linux-musl, ${{ matrix.os }}" + needs: common-7f790bc6d2444edacd5337c9048dae13842eb9ff + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-aarch64-linux-musl-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-aarch64-linux-musl + ${{ runner.os }}-on-${{ runner.arch }}-common-7f790bc6d2444edacd5337c9048dae13842eb9ff + enableCrossOsArchive: true + + - name: Build the image layers aarch64-linux-musl on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-723ac6e8df696b68867754088d542e27005deaaf RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + common-7f790bc6d2444edacd5337c9048dae13842eb9ff: + name: "build common-7f790bc6d2444edacd5337c9048dae13842eb9ff, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-common-7f790bc6d2444edacd5337c9048dae13842eb9ff-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-common-7f790bc6d2444edacd5337c9048dae13842eb9ff + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers common-7f790bc6d2444edacd5337c9048dae13842eb9ff on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-7f790bc6d2444edacd5337c9048dae13842eb9ff RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + arm-linux-musl: + name: "build arm-linux-musl, ${{ matrix.os }}" + needs: common-7f790bc6d2444edacd5337c9048dae13842eb9ff + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-arm-linux-musl-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-arm-linux-musl + ${{ runner.os }}-on-${{ runner.arch }}-common-7f790bc6d2444edacd5337c9048dae13842eb9ff + enableCrossOsArchive: true + + - name: Build the image layers arm-linux-musl on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-fbc527a24691e48b3ceae3946e031e5e7e88c321 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + x86-linux-musl: + name: "build x86-linux-musl, ${{ matrix.os }}" + needs: common-7f790bc6d2444edacd5337c9048dae13842eb9ff + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-x86-linux-musl-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-x86-linux-musl + ${{ runner.os }}-on-${{ runner.arch }}-common-7f790bc6d2444edacd5337c9048dae13842eb9ff + enableCrossOsArchive: true + + - name: Build the image layers x86-linux-musl on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-63da25377d0818f37111c2410d4816b73d1a9060 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + x86_64-linux-musl: + name: "build x86_64-linux-musl, ${{ matrix.os }}" + needs: common-7f790bc6d2444edacd5337c9048dae13842eb9ff + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-x86_64-linux-musl-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-x86_64-linux-musl + ${{ runner.os }}-on-${{ runner.arch }}-common-7f790bc6d2444edacd5337c9048dae13842eb9ff + enableCrossOsArchive: true + + - name: Build the image layers x86_64-linux-musl on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-dc7239babc93dee187ce0f0fa030de8c792e8611 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + arm64-darwin: + name: "build arm64-darwin, ${{ matrix.os }}" + needs: common-d1f437046b79903f679102aadd5269e80f584d09 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-arm64-darwin-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-arm64-darwin + ${{ runner.os }}-on-${{ runner.arch }}-common-d1f437046b79903f679102aadd5269e80f584d09 + enableCrossOsArchive: true + + - name: Build the image layers arm64-darwin on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-2829589da6681b1b5f379e6d68ff6be60cba5cf6 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + common-d1f437046b79903f679102aadd5269e80f584d09: + name: "build common-d1f437046b79903f679102aadd5269e80f584d09, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-common-d1f437046b79903f679102aadd5269e80f584d09-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-common-d1f437046b79903f679102aadd5269e80f584d09 + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers common-d1f437046b79903f679102aadd5269e80f584d09 on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-d1f437046b79903f679102aadd5269e80f584d09 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + x86_64-darwin: + name: "build x86_64-darwin, ${{ matrix.os }}" + needs: common-d1f437046b79903f679102aadd5269e80f584d09 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-x86_64-darwin-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-x86_64-darwin + ${{ runner.os }}-on-${{ runner.arch }}-common-d1f437046b79903f679102aadd5269e80f584d09 + enableCrossOsArchive: true + + - name: Build the image layers x86_64-darwin on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-bc540754626a1ebf8164f8ae4378b9104b383663 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + aarch64-linux-gnu: + name: "build aarch64-linux-gnu, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-aarch64-linux-gnu-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-aarch64-linux-gnu + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers aarch64-linux-gnu on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-b45d14aea28f4d30cfaa5bc6a34d751db67da79f RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + common-8c26987a5e78ace67587139520ec4d44e00a8f54: + name: "build common-8c26987a5e78ace67587139520ec4d44e00a8f54, ${{ matrix.os }}" + needs: common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + ${{ runner.os }}-on-${{ runner.arch }}-common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0 + enableCrossOsArchive: true + + - name: Build the image layers common-8c26987a5e78ace67587139520ec4d44e00a8f54 on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-8c26987a5e78ace67587139520ec4d44e00a8f54 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + aarch64-mingw-ucrt: + name: "build aarch64-mingw-ucrt, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-aarch64-mingw-ucrt-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-aarch64-mingw-ucrt + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers aarch64-mingw-ucrt on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-2378386d2f098439bb4555bfc930aa62eab2dd65 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + arm-linux-gnu: + name: "build arm-linux-gnu, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-arm-linux-gnu-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-arm-linux-gnu + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers arm-linux-gnu on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-8fd4771bba44643d3934e41c218db66645f9e96f RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + x64-mingw-ucrt: + name: "build x64-mingw-ucrt, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-x64-mingw-ucrt-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-x64-mingw-ucrt + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers x64-mingw-ucrt on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-fad6604335c2d8c64475e5d69c083d0cce4f63a7 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + x64-mingw32: + name: "build x64-mingw32, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-x64-mingw32-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-x64-mingw32 + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers x64-mingw32 on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-c435c444a8baec018c75861cf5b32aeb9345683e RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + x86-linux-gnu: + name: "build x86-linux-gnu, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-x86-linux-gnu-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-x86-linux-gnu + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers x86-linux-gnu on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-cda3746d187096bfcb5179842dc5b8f845ea3da6 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + x86-mingw32: + name: "build x86-mingw32, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-x86-mingw32-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-x86-mingw32 + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers x86-mingw32 on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-697f3ca4a0ddea1b26a66aee35ab6fc30ae3010b RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + x86_64-linux-gnu: + name: "build x86_64-linux-gnu, ${{ matrix.os }}" + needs: common-8c26987a5e78ace67587139520ec4d44e00a8f54 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-x86_64-linux-gnu-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-x86_64-linux-gnu + ${{ runner.os }}-on-${{ runner.arch }}-common-8c26987a5e78ace67587139520ec4d44e00a8f54 + enableCrossOsArchive: true + + - name: Build the image layers x86_64-linux-gnu on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-7b065f9c97f9d9f355f67f09b97c844d21539e42 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0: + name: "build common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0, ${{ matrix.os }}" + + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0 + ${{ runner.os }}-on-${{ runner.arch }}- + enableCrossOsArchive: true + + - name: Build the image layers common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0 on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + jruby: + name: "build jruby, ${{ matrix.os }}" + needs: common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0 + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-jruby-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-jruby + ${{ runner.os }}-on-${{ runner.arch }}-common-8a6d86116e9a9ffad5888a4a8b7fbee50535dbe0 + enableCrossOsArchive: true + + - name: Build the image layers jruby on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:common-58bf949eac408202d0b3113ff93f6330354c92a1 RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} + + build_source_gem: name: build source runs-on: ubuntu-latest @@ -41,12 +824,10 @@ jobs: build_native_gem: name: build native + needs: [aarch64-linux-gnu,aarch64-linux-musl,aarch64-mingw-ucrt,arm-linux-gnu,arm-linux-musl,arm64-darwin,x64-mingw-ucrt,x64-mingw32,x86-linux-gnu,x86-linux-musl,x86-mingw32,x86_64-darwin,x86_64-linux-gnu,x86_64-linux-musl,jruby] strategy: fail-fast: false matrix: - os: - - ubuntu-latest - - ubuntu-24.04-arm platform: - aarch64-linux-gnu - aarch64-linux-musl @@ -63,6 +844,9 @@ jobs: - x86_64-darwin - x86_64-linux-gnu - x86_64-linux-musl + os: + # - ubuntu-latest + - ubuntu-24.04-arm include: - platform: aarch64-linux-gnu alias: aarch64-linux @@ -93,23 +877,25 @@ jobs: ruby-version: "3.3" bundler-cache: true + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Fetch docker buildx layer cache uses: actions/cache@v4 with: path: tmp/build-cache-${{ runner.arch }} - key: ${{ runner.os }}-on-${{ runner.arch }}-${{ matrix.platform }}-buildxz-${{ github.sha }} - restore-keys: ${{ runner.os }}-on-${{ runner.arch }}-${{ matrix.platform }}-buildxz + key: ${{ runner.os }}-on-${{ runner.arch }}-${{ matrix.platform }}-${{ github.sha }} + restore-keys: ${{ runner.os }}-on-${{ runner.arch }}-${{ matrix.platform }} enableCrossOsArchive: true - - name: Change docker to a cache-able driver + + - name: Build the image from already filled cache + env: + RCD_TASK_DEPENDENCIES: "false" run: | - docker buildx create --driver docker-container --use - bundle exec rake build:${{ matrix.platform }} RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + bundle exec rake build:${{ matrix.platform }} RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }}" + - name: Show docker images run: docker images - - name: Update and prune docker buildx layer cache - run: | - rm -rf tmp/build-cache-${{ runner.arch }} - mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} - name: Test the generated image run: bundle exec rake test TEST_PLATFORM=${{ matrix.platform }} @@ -122,7 +908,7 @@ jobs: bundle exec rake gem:${{ matrix.platform }} - name: Upload native gem - if: runner.arch == 'X64' + if: runner.arch == 'ARM64' uses: actions/upload-artifact@v4 with: name: gem-${{ matrix.platform }} @@ -138,7 +924,7 @@ jobs: bundle exec rake clean clobber bundle exec rake gem:${{ matrix.platform }} - - if: matrix.static && runner.arch == 'X64' + - if: matrix.static && runner.arch == 'ARM64' name: Upload static native gem uses: actions/upload-artifact@v4 with: @@ -153,7 +939,7 @@ jobs: bundle exec rake clean clobber bundle exec rake gem:${{ matrix.alias }} - - if: matrix.alias && runner.arch == 'X64' + - if: matrix.alias && runner.arch == 'ARM64' name: Upload native gem ${{ matrix.alias }} uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/ci.yml.erb b/.github/workflows/ci.yml.erb new file mode 100644 index 0000000..b9e734c --- /dev/null +++ b/.github/workflows/ci.yml.erb @@ -0,0 +1,474 @@ +<%= "# This file is generated. Please edit publish-images.yml.erb instead!" %> + +name: CI +concurrency: + group: "${{github.workflow}}-${{github.ref}}" + cancel-in-progress: true +on: + workflow_dispatch: + schedule: + - cron: "0 5 * * 3" # At 05:00 on Wednesday # https://crontab.guru/#0_5_*_*_3 + push: + branches: + - main + tags: + - "*.*.*" + pull_request: + types: [opened, synchronize] + branches: + - "*" + +jobs: +<% parallel_docker_build.tree_deps.to_a.flatten.uniq.each do |tree_dep| + dockerfile = parallel_docker_build.final_deps.invert[tree_dep] + job = dockerfile ? dockerfile[/[-\w]+$/] : tree_dep +%> + <%= job %>: + name: "build <%= job %>, ${{ matrix.os }}" + <%= need = parallel_docker_build.tree_deps[tree_dep]; "needs: #{need}" if need %> + strategy: + fail-fast: false + matrix: + os: + # - ubuntu-latest + - ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-<%= job %>-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-on-${{ runner.arch }}-<%= job %> + ${{ runner.os }}-on-${{ runner.arch }}-<%= need %> + enableCrossOsArchive: true + + - name: Build the image layers <%= job %> on ${{ runner.arch }} + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:<%= tree_dep %> RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }} --cache-to=type=local,compression=zstd,dest=tmp/build-cache-new" + + - name: Update and prune docker buildx layer cache + run: | + rm -rf tmp/build-cache-${{ runner.arch }} + mv tmp/build-cache-new tmp/build-cache-${{ runner.arch }} +<% end %> + + build_source_gem: + name: build source + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + working-directory: test/rcd_test + bundler-cache: true + + - name: Build source gem + run: | + cd test/rcd_test/ + bundle exec rake gem + + - name: Upload source gem + uses: actions/upload-artifact@v4 + with: + name: gem-ruby + path: test/rcd_test/pkg/rcd_test-?.?.?.gem # e.g. rcd_test-1.0.0.gem + + build_native_gem: + name: build native + needs: [<%= parallel_docker_build.final_deps.keys.map{|a| a[/[-\w]+$/] }.join(",") %>] + strategy: + fail-fast: false + matrix: + platform: + - aarch64-linux-gnu + - aarch64-linux-musl + - aarch64-mingw-ucrt + - arm-linux-gnu + - arm-linux-musl + - arm64-darwin + - jruby + - x64-mingw-ucrt + - x64-mingw32 + - x86-linux-gnu + - x86-linux-musl + - x86-mingw32 + - x86_64-darwin + - x86_64-linux-gnu + - x86_64-linux-musl + os: + # - ubuntu-latest + - ubuntu-24.04-arm + include: + - platform: aarch64-linux-gnu + alias: aarch64-linux + - platform: aarch64-linux-musl + - platform: aarch64-mingw-ucrt + - platform: arm-linux-gnu + alias: arm-linux + - platform: arm-linux-musl + - platform: arm64-darwin + - platform: jruby + - platform: x64-mingw-ucrt + static: true + - platform: x64-mingw32 + static: true + - platform: x86-linux-gnu + alias: x86-linux + - platform: x86-linux-musl + - platform: x86-mingw32 + - platform: x86_64-darwin + - platform: x86_64-linux-gnu + alias: x86_64-linux + - platform: x86_64-linux-musl + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + bundler-cache: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Fetch docker buildx layer cache + uses: actions/cache@v4 + with: + path: tmp/build-cache-${{ runner.arch }} + key: ${{ runner.os }}-on-${{ runner.arch }}-${{ matrix.platform }}-${{ github.sha }} + restore-keys: ${{ runner.os }}-on-${{ runner.arch }}-${{ matrix.platform }} + enableCrossOsArchive: true + + - name: Build the image from already filled cache + env: + RCD_TASK_DEPENDENCIES: "false" + run: | + bundle exec rake build:${{ matrix.platform }} RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,compression=zstd,src=tmp/build-cache-${{ runner.arch }}" + + - name: Show docker images + run: docker images + + - name: Test the generated image + run: bundle exec rake test TEST_PLATFORM=${{ matrix.platform }} + + - name: Build native gem + run: | + cd test/rcd_test/ + bundle install + bundle exec rake clean clobber + bundle exec rake gem:${{ matrix.platform }} + + - name: Upload native gem + if: runner.arch == 'ARM64' + uses: actions/upload-artifact@v4 + with: + name: gem-${{ matrix.platform }} + path: test/rcd_test/pkg/*-*-*.gem + + - if: matrix.static + name: Build static native gem + env: + RCD_TEST_CONFIG: "--link-static" + run: | + cd test/rcd_test/ + bundle install + bundle exec rake clean clobber + bundle exec rake gem:${{ matrix.platform }} + + - if: matrix.static && runner.arch == 'ARM64' + name: Upload static native gem + uses: actions/upload-artifact@v4 + with: + name: gem-${{ matrix.platform }}-static + path: test/rcd_test/pkg/*-*-*.gem + + - if: matrix.alias + name: Build native gem ${{ matrix.alias }} + run: | + cd test/rcd_test/ + bundle install + bundle exec rake clean clobber + bundle exec rake gem:${{ matrix.alias }} + + - if: matrix.alias && runner.arch == 'ARM64' + name: Upload native gem ${{ matrix.alias }} + uses: actions/upload-artifact@v4 + with: + name: gem-${{ matrix.alias }} + path: test/rcd_test/pkg/*-*-*.gem + + test_source_gem: + name: source gem + needs: build_source_gem + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Download source gem + uses: actions/download-artifact@v4 + with: + name: gem-ruby + - name: Test source gem + run: | + gem install --local *.gem --verbose + cd test/rcd_test/ + bundle install + ruby -rrcd_test -S rake test + + test-x86_64-linux-setup-ruby: + name: "${{ matrix.platform }} setup-ruby(${{ matrix.ruby }})" + needs: build_native_gem + strategy: + fail-fast: false + matrix: + platform: [x86_64-linux, x86_64-linux-gnu] + ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"] + include: + # declare rubygems for each ruby version + - { ruby: "3.0", rubygems: "3.5.23" } + - { ruby: "2.7", rubygems: "3.4.22" } + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Download gem-${{ matrix.platform }} + uses: actions/download-artifact@v4 + with: + name: gem-${{ matrix.platform }} + - if: matrix.rubygems + run: gem update --system ${{ matrix.rubygems }} + - name: Test gem-${{ matrix.platform }} + run: | + gem install --local *.gem --verbose + cd test/rcd_test/ + bundle install + ruby -rrcd_test -S rake test + + test_architecture_matrix: + name: "${{ matrix.platform }} ${{ matrix.ruby }}" + needs: build_native_gem + strategy: + fail-fast: false + matrix: + platform: + - aarch64-linux + - aarch64-linux-gnu + - aarch64-linux-musl + - arm-linux + - arm-linux-gnu + - arm-linux-musl + - x86-linux + - x86-linux-gnu + - x86-linux-musl + - x86_64-linux + - x86_64-linux-gnu + - x86_64-linux-musl + ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"] + include: + # declare rubygems for each ruby version + - { ruby: "3.0", rubygems: "3.5.23" } + - { ruby: "2.7", rubygems: "3.4.22" } + # declare docker image for each platform + - { platform: aarch64-linux-musl, runon: "ubuntu-24.04-arm", docker_tag: "-alpine" } + - { platform: arm-linux-musl, runon: "ubuntu-24.04-arm", docker_tag: "-alpine" } + - { platform: x86-linux-musl, runon: "ubuntu-latest", docker_tag: "-alpine" } + - { platform: x86_64-linux-musl, runon: "ubuntu-latest", docker_tag: "-alpine" } + - { platform: x86_64-linux, runon: "ubuntu-latest" } + - { platform: x86_64-linux-gnu, runon: "ubuntu-latest" } + # declare docker platform for each platform + - { platform: aarch64-linux, runon: "ubuntu-24.04-arm", docker_platform: "--platform=linux/arm64" } + - { platform: aarch64-linux-gnu, runon: "ubuntu-24.04-arm", docker_platform: "--platform=linux/arm64" } + - { platform: aarch64-linux-musl, runon: "ubuntu-24.04-arm", docker_platform: "--platform=linux/arm64" } + - { platform: arm-linux, runon: "ubuntu-24.04-arm", docker_platform: "--platform=linux/arm/v7" } + - { platform: arm-linux-gnu, runon: "ubuntu-24.04-arm", docker_platform: "--platform=linux/arm/v7" } + - { platform: arm-linux-musl, runon: "ubuntu-24.04-arm", docker_platform: "--platform=linux/arm/v7" } + - { platform: x86-linux, runon: "ubuntu-latest", docker_platform: "--platform=linux/386" } + - { platform: x86-linux-gnu, runon: "ubuntu-latest", docker_platform: "--platform=linux/386" } + - { platform: x86-linux-musl, runon: "ubuntu-latest", docker_platform: "--platform=linux/386" } + runs-on: ${{ matrix.runon }} + steps: + - uses: actions/checkout@v4 + - name: Download gem-${{ matrix.platform }} + uses: actions/download-artifact@v4 + with: + name: gem-${{ matrix.platform }} + - name: Run tests + run: | + docker run --rm -v $PWD:/work -w /work \ + ${{ matrix.docker_platform}} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \ + sh -c " + if test -n '${{ matrix.rubygems }}' ; then gem update --system ${{ matrix.rubygems }} ; fi && + gem install --local *.gem --verbose && + cd test/rcd_test/ && + bundle install && + ruby -rrcd_test -S rake test + " + + test_the_rest: + name: "${{ matrix.platform }} ${{ matrix.ruby }}" + needs: build_native_gem + strategy: + fail-fast: false + matrix: + os: [macos-13, macos-14] + ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"] + include: + - os: macos-13 + platform: x86_64-darwin + - os: macos-14 + platform: arm64-darwin + - os: ubuntu-latest + ruby: jruby + platform: jruby + - os: windows-latest + ruby: "2.7" + platform: x64-mingw32 + - os: windows-latest + ruby: "3.0" + platform: x64-mingw32 + - os: windows-latest + ruby: "3.1" + platform: x64-mingw-ucrt + - os: windows-latest + ruby: "3.2" + platform: x64-mingw-ucrt + - os: windows-latest + ruby: "3.3" + platform: x64-mingw-ucrt + - os: windows-latest + ruby: "3.4" + platform: x64-mingw-ucrt + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Print ruby version and gem env + run: | + ruby --version + gem env + - name: Download gem-${{ matrix.platform }} + uses: actions/download-artifact@v4 + with: + name: gem-${{ matrix.platform }} + - name: Test gem-${{ matrix.platform }} + run: | + gem install --local *.gem --verbose + cd test/rcd_test/ + bundle install + ruby -rrcd_test -S rake test + + test_windows_static: + name: "static ${{ matrix.platform }} ${{ matrix.ruby }}" + needs: build_native_gem + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + ruby: "2.7" + platform: x64-mingw32 + - os: windows-latest + ruby: "3.0" + platform: x64-mingw32 + - os: windows-latest + ruby: "3.1" + platform: x64-mingw-ucrt + - os: windows-latest + ruby: "3.2" + platform: x64-mingw-ucrt + - os: windows-latest + ruby: "3.3" + platform: x64-mingw-ucrt + - os: windows-latest + ruby: "3.4" + platform: x64-mingw-ucrt + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Print ruby version and gem env + run: | + ruby --version + gem env + - name: Download gem-${{ matrix.platform }}-static + uses: actions/download-artifact@v4 + with: + name: gem-${{ matrix.platform }}-static + - name: Test gem-${{ matrix.platform }}-static + run: | + gem install --local *.gem --verbose + cd test/rcd_test/ + bundle install + ruby -rrcd_test -S rake test + + test_ad_hoc: + name: "${{ matrix.platform }} on ${{ matrix.from_image }}" + needs: build_native_gem + strategy: + fail-fast: false + matrix: + include: + - runon: ubuntu-24.04-arm + from_image: navikey/raspbian-bullseye + image_platform: linux/arm/v7 + platform: arm-linux # bullseye ships ruby 2.7, rubygems won't recognize -gnu suffix + dockerfile: debian + - runon: ubuntu-24.04-arm + from_image: arm64v8/ubuntu + image_platform: linux/aarch64 + platform: aarch64-linux # arm64v8 ships ruby 3.0, rubygems won't recognize -gnu suffix + dockerfile: debian + - runon: ubuntu-latest + from_image: i386/alpine + image_platform: linux/386 + platform: x86-linux-musl + dockerfile: alpine + - runon: ubuntu-24.04-arm + from_image: arm32v6/alpine + image_platform: linux/arm/v6 + platform: arm-linux-musl + dockerfile: alpine + - runon: ubuntu-latest + from_image: alpine + image_platform: linux/amd64 + platform: x86_64-linux-musl + dockerfile: alpine + runs-on: ${{ matrix.runon }} + steps: + - uses: actions/checkout@v4 + - name: Download gem-${{ matrix.platform }} + uses: actions/download-artifact@v4 + with: + name: gem-${{ matrix.platform }} + - name: Build ${{ matrix.from_image }} image + run: | + docker build --rm --build-arg from_image=${{ matrix.from_image }} --platform=${{ matrix.image_platform }} -t ruby-test -f test/env/Dockerfile.${{ matrix.dockerfile }} . + - name: Run tests + run: docker run --rm -t --network=host -v `pwd`:/build ruby-test diff --git a/Rakefile b/Rakefile index dbedb71..3b77f44 100644 --- a/Rakefile +++ b/Rakefile @@ -14,11 +14,9 @@ def build_mri_images(platforms, host_platforms, output: ) sdf = "tmp/docker/Dockerfile.mri.#{platform}" image_name = RakeCompilerDock::Starter.container_image_name(platform: platform) - RakeCompilerDock.docker_build(sdf, tag: image_name, platform: plats, output: output) - - if image_name.include?("linux-gnu") - RakeCompilerDock.docker_build(sdf, tag: image_name.sub("linux-gnu", "linux"), platform: plats, output: output) - end + tags = [image_name] + tags << image_name.sub("linux-gnu", "linux") if image_name.include?("linux-gnu") + RakeCompilerDock.docker_build(sdf, tag: tags, platform: plats, output: output) end end @@ -71,7 +69,14 @@ File.write(sdf, df) parallel_docker_build = RakeCompilerDock::ParallelDockerBuild.new(platforms.map{|pl, _| "tmp/docker/Dockerfile.mri.#{pl}" } + ["tmp/docker/Dockerfile.jruby"], workdir: "tmp/docker", task_prefix: "common-") namespace :build do - parallel_docker_build.define_rake_tasks platform: docker_platform + parallel_docker_build.define_file_tasks platform: docker_platform + + # The jobs in the CI pipeline are already organized in a tree structure. + # So we can avoid unnecessary rebuilds by omitting the dependecies. + unless ENV['RCD_TASK_DEPENDENCIES'] = "false" + parallel_docker_build.define_tree_tasks + parallel_docker_build.define_final_tasks + end platforms.each do |platform, target| sdf = "tmp/docker/Dockerfile.mri.#{platform}" @@ -226,5 +231,8 @@ namespace :ci do sdf = ".github/workflows/release-images.yml" release = true File.write(sdf, erb.result(binding)) + erb = ERB.new(File.read(".github/workflows/ci.yml.erb")) + sdf = ".github/workflows/ci.yml" + File.write(sdf, erb.result(binding)) end end diff --git a/build/parallel_docker_build.rb b/build/parallel_docker_build.rb index 2922f38..41698a2 100644 --- a/build/parallel_docker_build.rb +++ b/build/parallel_docker_build.rb @@ -25,7 +25,7 @@ def docker_build_cmd(platform=nil) def docker_build(filename, tag: nil, output: false, platform: ) cmd = docker_build_cmd(platform) return if cmd.nil? - tag_args = ["-t", tag] if tag + tag_args = Array(tag).flat_map{|t| ["-t", t] } if tag push_args = ["--push"] if output == 'push' push_args = ["--load"] if output == 'load' Class.new.extend(FileUtils).sh(*cmd, "-f", filename, ".", "--platform", platform, *tag_args, *push_args) @@ -132,16 +132,28 @@ def write_docker_files(vcs, workdir, task_prefix, plines=[]) # The rake tasks are named after the dockerfiles given to #new . # This also adds dependant intermediate tasks as prerequisites. def define_rake_tasks(**build_options) + define_file_tasks(**build_options) + define_tree_tasks + define_final_tasks + end + + def define_file_tasks(**build_options) file_deps.each do |fn, wfn| # p file_deps: {fn => wfn} task fn do RakeCompilerDock.docker_build(wfn, **build_options) end end + end + + def define_tree_tasks tree_deps.each do |file, prereq| # p tree_deps: {file => prereq} task file => prereq end + end + + def define_final_tasks final_deps.each do |file, prereq| # p final_deps: {file => prereq} task file => prereq