From b1be375b59171feed0544d0bb67dc118bb39473a Mon Sep 17 00:00:00 2001 From: Jan Baudisch Date: Wed, 14 Aug 2024 17:27:24 +0200 Subject: [PATCH] feat(ci): enable aarch64 build --- .github/workflows/CI.yaml | 11 ++- .github/workflows/Container.yaml | 58 ++++++------ .github/workflows/Kotlin.yaml | 148 +++++++++++++++---------------- .github/workflows/Pages.yaml | 2 +- .github/workflows/Portable.yaml | 56 ++++++------ .github/workflows/Python.yaml | 64 ++++++------- 6 files changed, 173 insertions(+), 166 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 838ca74..515763c 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -5,7 +5,7 @@ on: jobs: Check: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -22,7 +22,9 @@ jobs: matrix: target: - double: x86_64-linux - runner: ubuntu-latest + runner: ubuntu-24.04 + - double: aarch64-linux + runner: ubuntu-24.04 - double: x86_64-darwin runner: macos-13 - double: aarch64-darwin @@ -47,8 +49,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install QEMU + if: ${{ matrix.target.double == 'aarch64-linux' }} + run: sudo apt-get install -y qemu-user-static - name: Nix uses: DeterminateSystems/nix-installer-action@v10 + with: + extra-conf: system = ${{ matrix.target.double }} - name: Cache uses: DeterminateSystems/magic-nix-cache-action@v4 - name: Build diff --git a/.github/workflows/Container.yaml b/.github/workflows/Container.yaml index 42110ee..75a0fbb 100644 --- a/.github/workflows/Container.yaml +++ b/.github/workflows/Container.yaml @@ -1,29 +1,29 @@ -name: Container - -on: - - push - -env: - REGISTRY: ghcr.io - IMAGE_NAME: softvare-group/ddnnife - TAG: ${{ github.ref_name }} - -jobs: - Build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Nix - uses: DeterminateSystems/nix-installer-action@v10 - - name: Cache - uses: DeterminateSystems/magic-nix-cache-action@v4 - - name: Build - run: nix build -L .#container - - name: Login - run: nix run nixpkgs#skopeo -- login $REGISTRY --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} - - name: Push - run: nix run nixpkgs#skopeo -- copy docker-archive:result docker://$REGISTRY/$IMAGE_NAME:$TAG - - name: Push latest tag - if: ${{ github.ref_type == 'tag' }} - run: nix run nixpkgs#skopeo -- copy docker://$REGISTRY/$IMAGE_NAME:$TAG docker://$REGISTRY/$IMAGE_NAME:latest +#name: Container +# +#on: +# - push +# +#env: +# REGISTRY: ghcr.io +# IMAGE_NAME: softvare-group/ddnnife +# TAG: ${{ github.ref_name }} +# +#jobs: +# Build: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Nix +# uses: DeterminateSystems/nix-installer-action@v10 +# - name: Cache +# uses: DeterminateSystems/magic-nix-cache-action@v4 +# - name: Build +# run: nix build -L .#container +# - name: Login +# run: nix run nixpkgs#skopeo -- login $REGISTRY --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} +# - name: Push +# run: nix run nixpkgs#skopeo -- copy docker-archive:result docker://$REGISTRY/$IMAGE_NAME:$TAG +# - name: Push latest tag +# if: ${{ github.ref_type == 'tag' }} +# run: nix run nixpkgs#skopeo -- copy docker://$REGISTRY/$IMAGE_NAME:$TAG docker://$REGISTRY/$IMAGE_NAME:latest diff --git a/.github/workflows/Kotlin.yaml b/.github/workflows/Kotlin.yaml index a145eae..e6d9981 100644 --- a/.github/workflows/Kotlin.yaml +++ b/.github/workflows/Kotlin.yaml @@ -1,74 +1,74 @@ -name: Kotlin - -on: - - push - -jobs: - Build: - strategy: - fail-fast: false - matrix: - target: - - double: x86_64-linux - jna: linux-x86-64 - runner: ubuntu-24.04 - docs: true - - double: x86_64-darwin - jna: darwin-x86-64 - runner: macos-13 - - double: aarch64-darwin - jna: darwin-aarch64 - runner: macos-latest - variant: - - '' - - '-d4' - exclude: - - target: { double: x86_64-darwin } - variant: '-d4' - runs-on: ${{ matrix.target.runner }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Nix - uses: DeterminateSystems/nix-installer-action@v10 - - name: Cache - uses: DeterminateSystems/magic-nix-cache-action@v4 - - name: Build (bindgen) - run: | - nix build -L .#bindgen - cp -L result/bin/uniffi-bindgen . - - name: Build (library) - run: | - nix build -L .#libddnnife${{ matrix.variant }} - mkdir -p libraries/${{ matrix.target.jna }} - cp -L result/lib/*ddnnife* libraries/${{ matrix.target.jna }}/ - - name: Build - run: | - cd bindings/kotlin - gradle shadowJar --no-daemon -Plibraries=../../libraries -Pbindgen=../../uniffi-bindgen - - name: Test - run: | - cd bindings/kotlin - gradle test --no-daemon -Plibraries=../../libraries -Pbindgen=../../uniffi-bindgen - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: ddnnife-kotlin-${{ matrix.target.double }}${{ matrix.variant }} - path: bindings/kotlin/build/libs - - name: Docs - if: ${{ matrix.target.docs && matrix.variant == '' }} - run: | - cd bindings/kotlin - gradle dokkaHtml --no-daemon -Plibraries=../../libraries -Pbindgen=../../uniffi-bindgen - mkdir docs - mv build/dokka/html docs/kotlin - - name: Upload (docs) - if: ${{ matrix.target.docs && matrix.variant == '' }} - uses: actions/upload-artifact@v4 - with: - name: pages-kotlin - path: bindings/kotlin/docs - Pages: - if: github.ref == 'refs/heads/main' - needs: Build - uses: ./.github/workflows/Pages.yaml +#name: Kotlin +# +#on: +# - push +# +#jobs: +# Build: +# strategy: +# fail-fast: false +# matrix: +# target: +# - double: x86_64-linux +# jna: linux-x86-64 +# runner: ubuntu-24.04 +# docs: true +# - double: x86_64-darwin +# jna: darwin-x86-64 +# runner: macos-13 +# - double: aarch64-darwin +# jna: darwin-aarch64 +# runner: macos-latest +# variant: +# - '' +# - '-d4' +# exclude: +# - target: { double: x86_64-darwin } +# variant: '-d4' +# runs-on: ${{ matrix.target.runner }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Nix +# uses: DeterminateSystems/nix-installer-action@v10 +# - name: Cache +# uses: DeterminateSystems/magic-nix-cache-action@v4 +# - name: Build (bindgen) +# run: | +# nix build -L .#bindgen +# cp -L result/bin/uniffi-bindgen . +# - name: Build (library) +# run: | +# nix build -L .#libddnnife${{ matrix.variant }} +# mkdir -p libraries/${{ matrix.target.jna }} +# cp -L result/lib/*ddnnife* libraries/${{ matrix.target.jna }}/ +# - name: Build +# run: | +# cd bindings/kotlin +# gradle shadowJar --no-daemon -Plibraries=../../libraries -Pbindgen=../../uniffi-bindgen +# - name: Test +# run: | +# cd bindings/kotlin +# gradle test --no-daemon -Plibraries=../../libraries -Pbindgen=../../uniffi-bindgen +# - name: Upload +# uses: actions/upload-artifact@v4 +# with: +# name: ddnnife-kotlin-${{ matrix.target.double }}${{ matrix.variant }} +# path: bindings/kotlin/build/libs +# - name: Docs +# if: ${{ matrix.target.docs && matrix.variant == '' }} +# run: | +# cd bindings/kotlin +# gradle dokkaHtml --no-daemon -Plibraries=../../libraries -Pbindgen=../../uniffi-bindgen +# mkdir docs +# mv build/dokka/html docs/kotlin +# - name: Upload (docs) +# if: ${{ matrix.target.docs && matrix.variant == '' }} +# uses: actions/upload-artifact@v4 +# with: +# name: pages-kotlin +# path: bindings/kotlin/docs +# Pages: +# if: github.ref == 'refs/heads/main' +# needs: Build +# uses: ./.github/workflows/Pages.yaml diff --git a/.github/workflows/Pages.yaml b/.github/workflows/Pages.yaml index 9bb9ed4..442ad44 100644 --- a/.github/workflows/Pages.yaml +++ b/.github/workflows/Pages.yaml @@ -1,4 +1,4 @@ -name: Pages +#name: Pages on: workflow_call diff --git a/.github/workflows/Portable.yaml b/.github/workflows/Portable.yaml index f2e414e..bbacefa 100644 --- a/.github/workflows/Portable.yaml +++ b/.github/workflows/Portable.yaml @@ -1,28 +1,28 @@ -name: Portable - -on: - - push - -jobs: - Build: - strategy: - fail-fast: false - matrix: - target: - - double: x86_64-linux - runner: ubuntu-latest - runs-on: ${{ matrix.target.runner }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Nix - uses: DeterminateSystems/nix-installer-action@v10 - - name: Cache - uses: DeterminateSystems/magic-nix-cache-action@v4 - - name: Bundle - run: nix bundle --bundler github:DavHau/nix-portable -o bundle .#ddnnife-d4 - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: ddnnife-${{ matrix.target.double }}-d4-portable - path: bundle +#name: Portable +# +#on: +# - push +# +#jobs: +# Build: +# strategy: +# fail-fast: false +# matrix: +# target: +# - double: x86_64-linux +# runner: ubuntu-latest +# runs-on: ${{ matrix.target.runner }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Nix +# uses: DeterminateSystems/nix-installer-action@v10 +# - name: Cache +# uses: DeterminateSystems/magic-nix-cache-action@v4 +# - name: Bundle +# run: nix bundle --bundler github:DavHau/nix-portable -o bundle .#ddnnife-d4 +# - name: Upload +# uses: actions/upload-artifact@v4 +# with: +# name: ddnnife-${{ matrix.target.double }}-d4-portable +# path: bundle diff --git a/.github/workflows/Python.yaml b/.github/workflows/Python.yaml index a9b12c7..c364071 100644 --- a/.github/workflows/Python.yaml +++ b/.github/workflows/Python.yaml @@ -1,32 +1,32 @@ -name: Python - -on: - - push - -jobs: - Build: - strategy: - fail-fast: false - matrix: - target: - - double: x86_64-linux - runner: ubuntu-latest - - double: x86_64-darwin - runner: macos-13 - - double: aarch64-darwin - runner: macos-latest - runs-on: ${{ matrix.target.runner }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Nix - uses: DeterminateSystems/nix-installer-action@v10 - - name: Cache - uses: DeterminateSystems/magic-nix-cache-action@v4 - - name: Build - run: nix build -L .#python - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: ddnnife-python-${{ matrix.target.double }} - path: result +#name: Python +# +#on: +# - push +# +#jobs: +# Build: +# strategy: +# fail-fast: false +# matrix: +# target: +# - double: x86_64-linux +# runner: ubuntu-latest +# - double: x86_64-darwin +# runner: macos-13 +# - double: aarch64-darwin +# runner: macos-latest +# runs-on: ${{ matrix.target.runner }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Nix +# uses: DeterminateSystems/nix-installer-action@v10 +# - name: Cache +# uses: DeterminateSystems/magic-nix-cache-action@v4 +# - name: Build +# run: nix build -L .#python +# - name: Upload +# uses: actions/upload-artifact@v4 +# with: +# name: ddnnife-python-${{ matrix.target.double }} +# path: result