From 8e9b4fffd340dc820350d1a3bc0972e00bcca16d Mon Sep 17 00:00:00 2001 From: Mads Ynddal Date: Wed, 8 May 2024 10:25:41 +0200 Subject: [PATCH] macOS GHA --- .github/workflows/build.yml | 132 ++++++++++++++++++++++-------------- 1 file changed, 81 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4b70df3..ec85f0bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -126,69 +126,99 @@ jobs: - name: compile run: meson compile -C build - dist-builds: - name: "distribution builds" + # dist-builds: + # name: "distribution builds" + + # needs: [sanity] + + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # container: + # - {os: 'almalinux', ver: '8'} + # - {os: 'almalinux', ver: '9'} + # - {os: 'alpine', ver: 'latest'} + # - {os: 'archlinux', ver: 'latest'} + # - {os: 'debian', ver: 'trixie'} + # - {os: 'debian', ver: 'bookworm'} + # - {os: 'debian', ver: 'bullseye'} + # - {os: 'debian', ver: 'buster'} + # - {os: 'fedora', ver: 'rawhide'} + # - {os: 'fedora', ver: '38'} + # - {os: 'fedora', ver: '37'} + # - {os: 'rockylinux', ver: '8'} + # - {os: 'rockylinux', ver: '9'} + # - {os: 'ubuntu', ver: 'mantic'} + # - {os: 'ubuntu', ver: 'lunar'} + # - {os: 'ubuntu', ver: 'jammy'} + # - {os: 'ubuntu', ver: 'focal'} + # - {os: 'macos', ver: 'latest'} + + # container: + # image: ${{ matrix.container.os }}:${{ matrix.container.ver }} + + # steps: + # - name: checkout + # uses: actions/checkout@v4 + + # - name: install dependencies + # env: + # SETUP_SCRIPT: .github/scripts/build/${{ matrix.container.os}}-setup-${{ matrix.container.ver }}.sh + # run: ${SETUP_SCRIPT} + + # - name: configure build + # run: meson setup build -Dlibnvme=disabled + + # - name: compile + # run: ninja -C build + + # - name: upload log + # uses: actions/upload-artifact@v3 + # if: failure() + # with: + # name: meson log + # path: build/meson-logs/meson-log.txt + + # - name: unit tests + # run: meson test -C build "libvfn:" + + # - name: upload log + # uses: actions/upload-artifact@v3 + # if: failure() + # with: + # name: meson test log + # path: build/meson-logs/testlog.txt + + macos-build: + name: "macOS build" needs: [sanity] - runs-on: ubuntu-latest + runs-on: macos-latest strategy: fail-fast: false - matrix: - container: - - {os: 'almalinux', ver: '8'} - - {os: 'almalinux', ver: '9'} - - {os: 'alpine', ver: 'latest'} - - {os: 'archlinux', ver: 'latest'} - - {os: 'debian', ver: 'trixie'} - - {os: 'debian', ver: 'bookworm'} - - {os: 'debian', ver: 'bullseye'} - - {os: 'debian', ver: 'buster'} - - {os: 'fedora', ver: 'rawhide'} - - {os: 'fedora', ver: '38'} - - {os: 'fedora', ver: '37'} - - {os: 'rockylinux', ver: '8'} - - {os: 'rockylinux', ver: '9'} - - {os: 'ubuntu', ver: 'mantic'} - - {os: 'ubuntu', ver: 'lunar'} - - {os: 'ubuntu', ver: 'jammy'} - - {os: 'ubuntu', ver: 'focal'} - - {os: 'macos', ver: 'latest'} - - container: - image: ${{ matrix.container.os }}:${{ matrix.container.ver }} steps: - name: checkout uses: actions/checkout@v4 - - - name: install dependencies - env: - SETUP_SCRIPT: .github/scripts/build/${{ matrix.container.os}}-setup-${{ matrix.container.ver }}.sh - run: ${SETUP_SCRIPT} - - - name: configure build - run: meson setup build -Dlibnvme=disabled - - - name: compile - run: ninja -C build - - - name: upload log - uses: actions/upload-artifact@v3 - if: failure() with: - name: meson log - path: build/meson-logs/meson-log.txt + repository: samsungds/macvfn + ref: libvfn4 # TODO: master - - name: unit tests - run: meson test -C build "libvfn:" + - name: Setup submodule + run: | + SUBMODULE_PATH="MacVFN/libvfn" + BRANCH_NAME=${GITHUB_HEAD_REF#refs/heads/} + git config -f .gitmodules submodule.$SUBMODULE_PATH.url ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} + git config -f .gitmodules submodule.$SUBMODULE_PATH.branch "$BRANCH_NAME" + cat .gitmodules - - name: upload log - uses: actions/upload-artifact@v3 - if: failure() - with: - name: meson test log - path: build/meson-logs/testlog.txt + - name: Install dependencies + run: brew install meson + + - name: Xcode build + run: make build device-test: name: "run emulated nvme device tests"