Skip to content

Commit

Permalink
ci: use arm and x86
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Feb 22, 2025
1 parent 468e829 commit b75f845
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 43 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Build container

on:
workflow_call:
inputs:
runs-on:
description: "Runner for building container"
required: false
type: string
default: "ubuntu-24.04-arm"
outputs:
path:
description: "Path to built container"
Expand All @@ -13,7 +19,7 @@ env:
jobs:
build:
name: Build container
runs-on: ubuntu-24.04-arm
runs-on: ${{ inputs.runs-on }}
outputs:
tag: ${{ steps.prepare.outputs.tag }}
repo: ${{ steps.prepare.outputs.repo }}
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/build-depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
description: "Path to built container at registry"
required: true
type: string
runs-on:
description: "Runner for building depends"
required: false
type: string
default: "ubuntu-24.04-arm"
outputs:
key:
description: "Key needed for restoring depends cache"
Expand All @@ -19,9 +24,9 @@ on:
jobs:
build-depends:
name: Build depends
runs-on: ubuntu-24.04-arm
runs-on: ${{ inputs.runs-on }}
outputs:
key: ${{ steps.restore.outputs.cache-primary-key }}
key: ${{ steps.restore.outputs.cache-primary-key }}
container:
image: ${{ inputs.container-path }}
options: --user root
Expand All @@ -41,7 +46,6 @@ jobs:
DEP_HASH="$(echo -n "${BUILD_TARGET}" "${DEP_OPTS}" "${HOST}" | sha256sum | head -c 64)"
echo "\"${BUILD_TARGET}\" has HOST=\"${HOST}\" and DEP_OPTS=\"${DEP_OPTS}\" with hash \"${DEP_HASH}\""
echo "DEP_HASH=${DEP_HASH}" >> "${GITHUB_OUTPUT}"
shell: bash

- name: Cache depends sources
Expand Down Expand Up @@ -77,7 +81,7 @@ jobs:
- name: Build depends
run: |
export HOST="${{ steps.setup.outputs.HOST }}"
export HOST="${{ steps.setup.outputs.HOST }}"
if [ "${HOST}" = "x86_64-apple-darwin" ]; then
./contrib/containers/guix/scripts/setup-sdk
fi
Expand All @@ -90,4 +94,4 @@ jobs:
path: |
depends/built
depends/${{ steps.setup.outputs.HOST }}
key: ${{ steps.restore.outputs.cache-primary-key }}
key: ${{ steps.restore.outputs.cache-primary-key }}
10 changes: 7 additions & 3 deletions .github/workflows/build-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ on:
description: "Key needed to access cached depends"
required: true
type: string

runs-on:
description: "Runner for building source"
required: false
type: string
default: "ubuntu-24.04-arm"
jobs:
build-src:
name: Build source
runs-on: ubuntu-24.04-arm
runs-on: ${{ inputs.runs-on }}
container:
image: ${{ inputs.container-path }}
options: --user root
Expand Down Expand Up @@ -88,4 +92,4 @@ jobs:
with:
name: build-artifacts-${{ inputs.build-target }}
path: |
/output
/output
92 changes: 58 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,144 +13,168 @@ env:
FAST_MODE: false

jobs:
container:
name: Build container
container-arm:
name: Build container (arm)
uses: ./.github/workflows/build-container.yml
with:
runs-on: ubuntu-24.04-arm

container-x86:
name: Build container (x86)
uses: ./.github/workflows/build-container.yml
with:
runs-on: ubuntu-24.04

depends-arm-linux:
name: arm-linux-gnueabihf
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container-arm]
with:
build-target: arm-linux
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
runs-on: ubuntu-24.04-arm

depends-linux64:
name: x86_64-pc-linux-gnu
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container-arm]
with:
build-target: linux64
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
runs-on: ubuntu-24.04-arm

depends-linux64_multiprocess:
name: x86_64-pc-linux-gnu_multiprocess
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container-arm]
with:
build-target: linux64_multiprocess
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
runs-on: ubuntu-24.04-arm

depends-linux64_nowallet:
name: x86_64-pc-linux-gnu_nowallet
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container-x86]
with:
build-target: linux64_nowallet
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-x86.outputs.path }}
runs-on: ubuntu-24.04

depends-mac:
name: x86_64-apple-darwin
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container-x86]
with:
build-target: mac
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-x86.outputs.path }}
runs-on: ubuntu-24.04

depends-win64:
name: x86_64-w64-mingw32
uses: ./.github/workflows/build-depends.yml
needs: [container]
needs: [container-x86]
with:
build-target: win64
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-x86.outputs.path }}
runs-on: ubuntu-24.04

src-arm-linux:
name: arm-linux-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-arm-linux]
needs: [container-arm, depends-arm-linux]
with:
build-target: arm-linux
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
depends-key: ${{ needs.depends-arm-linux.outputs.key }}
runs-on: ubuntu-24.04-arm

src-linux64:
name: linux64-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-linux64]
needs: [container-arm, depends-linux64]
with:
build-target: linux64
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
depends-key: ${{ needs.depends-linux64.outputs.key }}
runs-on: ubuntu-24.04-arm

src-linux64_fuzz:
name: linux64_fuzz-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-linux64]
needs: [container-arm, depends-linux64]
with:
build-target: linux64_fuzz
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
depends-key: ${{ needs.depends-linux64.outputs.key }}
runs-on: ubuntu-24.04-arm

src-linux64_multiprocess:
name: linux64_multiprocess-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-linux64_multiprocess]
needs: [container-arm, depends-linux64_multiprocess]
with:
build-target: linux64_multiprocess
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
depends-key: ${{ needs.depends-linux64_multiprocess.outputs.key }}
runs-on: ubuntu-24.04-arm

src-linux64_nowallet:
name: linux64_nowallet-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-linux64_nowallet]
needs: [container-x86, depends-linux64_nowallet]
with:
build-target: linux64_nowallet
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-x86.outputs.path }}
depends-key: ${{ needs.depends-linux64_nowallet.outputs.key }}
runs-on: ubuntu-24.04

src-linux64_sqlite:
name: linux64_sqlite-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-linux64]
needs: [container-arm, depends-linux64]
with:
build-target: linux64_sqlite
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
depends-key: ${{ needs.depends-linux64.outputs.key }}
runs-on: ubuntu-24.04-arm

src-linux64_tsan:
name: linux64_tsan-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-linux64_multiprocess]
needs: [container-arm, depends-linux64_multiprocess]
with:
build-target: linux64_tsan
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
depends-key: ${{ needs.depends-linux64_multiprocess.outputs.key }}
runs-on: ubuntu-24.04-arm

src-linux64_ubsan:
name: linux64_ubsan-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-linux64]
needs: [container-arm, depends-linux64]
with:
build-target: linux64_ubsan
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-arm.outputs.path }}
depends-key: ${{ needs.depends-linux64.outputs.key }}
runs-on: ubuntu-24.04-arm

src-mac:
name: mac-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-mac]
needs: [container-x86, depends-mac]
with:
build-target: mac
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-x86.outputs.path }}
depends-key: ${{ needs.depends-mac.outputs.key }}
runs-on: ubuntu-24.04

src-win64:
name: win64-build
uses: ./.github/workflows/build-src.yml
needs: [container, depends-win64]
needs: [container-x86, depends-win64]
with:
build-target: win64
container-path: ${{ needs.container.outputs.path }}
container-path: ${{ needs.container-x86.outputs.path }}
depends-key: ${{ needs.depends-win64.outputs.key }}
runs-on: ubuntu-24.04

0 comments on commit b75f845

Please sign in to comment.