From d2e97e538ec31a959b946096e7312861f91fb37d Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Thu, 24 Oct 2024 19:24:24 +0100 Subject: [PATCH] wip --- .github/workflows/baboon-build.yml | 59 ++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/.github/workflows/baboon-build.yml b/.github/workflows/baboon-build.yml index df7a635..89a3cfb 100644 --- a/.github/workflows/baboon-build.yml +++ b/.github/workflows/baboon-build.yml @@ -13,7 +13,7 @@ permissions: actions: write jobs: - build-unix: + build-linux: strategy: fail-fast: false matrix: @@ -23,17 +23,48 @@ jobs: - target: linux-amd64 os: ubuntu-latest runs-on: [ ] - linux: true - target: linux-aarch64 os: self-hosted runs-on: [ "ARM64" ] preconfigured: true nix-cache-disabled: true - linux: true + name: ${{ matrix.target }} + runs-on: + - ${{ matrix.os }} + - ${{ matrix.runs-on }} + steps: + - uses: actions/checkout@v4 + - name: Install Nix (Linux) + if: matrix.preconfigured != true + uses: nixbuild/nix-quick-install-action@v27 + - name: Restore and cache Nix store + uses: nix-community/cache-nix-action@v5 + if: matrix.preconfigured != true + with: + primary-key: nix-${{ matrix.target }}-${{ hashFiles('**/*.nix') }} + restore-prefixes-first-match: nix-${{ matrix.target }}- + gc-max-store-size-linux: 1073741824 + purge: true + purge-prefixes: cache-${{ matrix.target }}- + purge-created: 0 + purge-primary-key: never + - name: Build (linux) + run: | + ./nix-rebuild.sh + - uses: actions/upload-artifact@v4 + with: + name: baboon-${{ matrix.target }} + path: | + target/graalvm-native-image/** + + build-unix: + strategy: + fail-fast: false + matrix: + include: - target: macos-aarch64-14 runs-on: [ ] os: macos-14 # yes, this is aarch64 - notlinux: true - target: macos-amd64-13 os: macos-13 # this is amd64 runs-on: [ ] @@ -43,34 +74,23 @@ jobs: - ${{ matrix.runs-on }} steps: - uses: actions/checkout@v4 - - name: Install Nix (Linux) - if: matrix.linux == true && matrix.preconfigured != true - uses: nixbuild/nix-quick-install-action@v27 - name: Install Nix (Mac) - if: matrix.linux != true && matrix.preconfigured != true + if: matrix.preconfigured != true uses: cachix/install-nix-action@v27 with: nix_path: nixpkgs=channel:nixos-unstable - name: Restore and cache Nix store uses: nix-community/cache-nix-action@v5 - if: matrix.linux == true && matrix.preconfigured != true + if: matrix.preconfigured != true with: - # restore and save a cache using this key primary-key: nix-${{ matrix.target }}-${{ hashFiles('**/*.nix') }} - # if there's no cache hit, restore a cache by this prefix restore-prefixes-first-match: nix-${{ matrix.target }}- gc-max-store-size-linux: 1073741824 - # do purge caches purge: true - # purge all versions of the cache purge-prefixes: cache-${{ matrix.target }}- - # created more than this number of seconds ago relative to the start of the `Post Restore` phase purge-created: 0 - # except the version with the `primary-key`, if it exists purge-primary-key: never - - name: Build (unix) # https://github.com/nixbuild/nix-quick-install-action/issues/3 -# env: -# NIX_BUILD_SHELL: bash + - name: Build (Mac) run: | ./nix-rebuild.sh - uses: actions/upload-artifact@v4 @@ -116,7 +136,8 @@ jobs: prepare-release: runs-on: ubuntu-latest needs: - - build-unix + - build-linux + - build-mac - build-windows steps: - uses: actions/checkout@v4