From: <al...@us...> - 2023-03-19 18:41:15
|
This is an automated email from the git hooks/post-receive-user script. allura pushed a commit to branch master in repository libspectrum. View the commit online: https://sourceforge.net/p/fuse-emulator/libspectrum/ci/78d80463bb404f9dc34c66593ce6df2732a3a170/ commit 78d80463bb404f9dc34c66593ce6df2732a3a170 Author: Miroslav Ďurčík / Arki55 <mir...@gm...> AuthorDate: Sun Feb 19 21:25:45 2023 +0100 arki55/features/T9-github-build-checks (libspectrum) build: Implemented build workflow for MACOS platform. - Executed on native MACOS runner hosted by GitHub. - Installer "apt" replaced by "brew", lib names adjusted to those available under MACOS. - As with WII, Linux and Windows, workflows split into 2 parts - sub part allowing configuration and all build steps and one file listing al available configuration variations. - GLIB seems to be available under MACOS, but not working for FUSE, therefore fake glib enabled for all build cases. - libaudiofile available, but somewhat not compatible with FUSE, therefore disabled for all build cases as well. - make check works --- .github/workflows/build_macos.yml | 70 ++++++++++++++ .github/workflows/build_macos_sub.yml | 177 ++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+) diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml new file mode 100644 index 0000000..21cb2a2 --- /dev/null +++ b/.github/workflows/build_macos.yml @@ -0,0 +1,70 @@ +name: Libspectrum for MacOS +run-name: Build and test Libspectrum for MacOS / ${{ github.actor }} / + +# Executed upon each commit pushed, merge commit in PR +on: [push, pull_request] + +jobs: + ################# + ### FAKE GLIB ### + ################# + + # 1. Default = all libs enabled, fake glib yes + default-fake-glib: + name: "Libspectrum + all libs (MacOS, fake glib)" + uses: ./.github/workflows/build_macos_sub.yml + with: + key: "default-fake-glib" + use_fake_glib: true + use_libaudiofile: false # FIXME: The available brew lib is not recognized by configure. + + # 2. Without zlib (fake glib) + no-zlib-fake-glib: + name: "Libspectrum w/o zlib (MacOS, fake glib)" + uses: ./.github/workflows/build_macos_sub.yml + with: + key: "no-zlib-fake-glib" + use_zlib: false + use_fake_glib: true + use_libaudiofile: false # FIXME: The available brew lib is not recognized by configure. + + # 3. Without bzip2 (fake glib) + no-bzip2-fake-glib: + name: "Libspectrum w/o bzip2 (MacOS, fake glib)" + uses: ./.github/workflows/build_macos_sub.yml + with: + key: "no-bzip2-fake-glib" + use_bzip2: false + use_fake_glib: true + use_libaudiofile: false # FIXME: The available brew lib is not recognized by configure. + + # 4. Without libgcrypt (fake glib) + no-libgcrypt-fake-glib: + name: "Libspectrum w/o libgcrypt (MacOS, fake glib)" + uses: ./.github/workflows/build_macos_sub.yml + with: + key: "no-libgcrypt-fake-glib" + use_libgcrypt: false + use_fake_glib: true + use_libaudiofile: false # FIXME: The available brew lib is not recognized by configure. + + # 5. Without libaudiofile (fake glib) + no-libaudiofile-fake-glib: + name: "Libspectrum w/o libaudiofile (MacOS, fake glib)" + uses: ./.github/workflows/build_macos_sub.yml + with: + key: "no-libaudiofile-fake-glib" + use_libaudiofile: false + use_fake_glib: true + + # 6. Without all libs (fake glib) + no-libs-fake-glib: + name: "Libspectrum w/o all libs (MacOS, fake glib)" + uses: ./.github/workflows/build_macos_sub.yml + with: + key: "no-libs-fake-glib" + use_zlib: false + use_bzip2: false + use_libgcrypt: false + use_libaudiofile: false + use_fake_glib: true diff --git a/.github/workflows/build_macos_sub.yml b/.github/workflows/build_macos_sub.yml new file mode 100644 index 0000000..05c7968 --- /dev/null +++ b/.github/workflows/build_macos_sub.yml @@ -0,0 +1,177 @@ +name: Libspectrum for MacOS +run-name: Build and test Libspectrum for MacOS / ${{ github.actor }} / + +on: + # Called from fuse app, fuse utils repos + workflow_call: + inputs: + # Name this setup (no spaces please) + key: + type: string + required: true + # Path where to clone + path: + type: string + required: false + default: '.' + # Which branch to checkout + branch: + type: string + required: false + default: "" + # Configure supported libs + use_zlib: + type: boolean + required: false + default: true + use_bzip2: + type: boolean + required: false + default: true + use_libgcrypt: + type: boolean + required: false + default: true + use_libaudiofile: + type: boolean + required: false + default: true + use_fake_glib: + type: boolean + required: false + default: false + # Repo is taken from var.LIBSPECTRUM_REPO, cannot be passed as input. + +jobs: + build: + name: Build & Test + runs-on: macos-latest + timeout-minutes: 15 + defaults: + run: + shell: bash + working-directory: ${{ inputs.path || '.' }} + env: + # Support push and call triggers, set env.variables + LIBSPECTRUM_REPO: ${{ vars.LIBSPECTRUM_REPO || '' }} + LIBSPECTRUM_BRANCH: ${{ inputs.branch || '' }} + LIBSPECTRUM_PATH: ${{ inputs.path || '.' }} + + steps: + - name: (1) Prepare environment + run: | + echo -n "Current directory: " + pwd + ls -la + + echo "Libspectrum repo: $LIBSPECTRUM_REPO" + echo "Libspectrum branch: $LIBSPECTRUM_BRANCH" + echo "Libspectrum path: $LIBSPECTRUM_PATH" + + echo "Use lib zlib: ${{ inputs.use_zlib && 'yes' || 'no' }}" + echo "Use lib bzip2: ${{ inputs.use_bzip2 && 'yes' || 'no' }}" + echo "Use lib libgcrypt: ${{ inputs.use_libgcrypt && 'yes' || 'no' }}" + echo "Use lib libaudiofile: ${{ inputs.use_libaudiofile && 'yes' || 'no' }}" + echo "Use fake glib: ${{ inputs.use_fake_glib && 'yes' || 'no' }}" + + - name: (2) Check out repository code + uses: actions/checkout@v3 + with: + repository: ${{ env.LIBSPECTRUM_REPO }} + ref: ${{ env.LIBSPECTRUM_BRANCH }} + path: ${{ env.LIBSPECTRUM_PATH }} + + - name: (3) Restore lib packages + run: | + echo "Not needed here" + + - name: (4) Install dependencies + run: | + echo "Inspect if brew installed .." + brew doctor || true + + echo "Installing dependencies .." + brew install \ + automake \ + audiofile \ + bzip2 \ + libgcrypt \ + glib \ + libxml2 + autoreconf -i + + - name: (5) Save lib packages + run: | + echo "Not needed here" + + - name: (6) Autogen.sh + run: | + echo "Running autogen.sh .." + ./autogen.sh + + - name: (7) Configure for MacOS + run: | + echo "Running configure .." + ./configure \ + ${{ inputs.use_zlib == false && '--without-zlib' || '' }} \ + ${{ inputs.use_bzip2 == false && '--without-bzip2' || '' }} \ + ${{ inputs.use_libgcrypt == false && '--without-libgcrypt' || '' }} \ + ${{ inputs.use_libaudiofile == false && '--without-libaudiofile' || '' }} \ + ${{ inputs.use_fake_glib == true && '--with-fake-glib' || '' }} \ + | tee ./configure.out + + - name: (8) Verify output from configure + run: | + .github/scripts/in_config.sh "libspectrum is ready to be compiled" + .github/scripts/in_config.sh "zlib support: ${{ inputs.use_zlib && 'yes' || 'no' }}" + .github/scripts/in_config.sh "bzip2 support: ${{ inputs.use_bzip2 && 'yes' || 'no' }}" + .github/scripts/in_config.sh "libgcrypt support: ${{ inputs.use_libgcrypt && 'yes' || 'no' }}" + .github/scripts/in_config.sh "libaudiofile support: ${{ inputs.use_libaudiofile && 'yes' || 'no' }}" + .github/scripts/in_config.sh "Internal GLib replacement: ${{ inputs.use_fake_glib && 'yes' || 'no' }}" + + - name: (9) Make + run: | + echo "Running make .." + make + + - name: (10) Install + run: | + echo "Running make install .." + sudo make install + + - name: (11) Copy dependencies + run: | + echo "Not needed here." + + - name: (12) Run tests + id: run-tests + run: | + echo "Bulding and running tests .." + make check + + - name: (13) Verbose check tests (on failure) + if: failure() && steps.run-tests.outcome != 'success' + run: | + cd ${GITHUB_WORKSPACE} + + echo "Listing all tests individually .." + test/test + + - name: (14) Pack installed library files + # Need to pack files to maintain permissions (+x mainly) + run: | + find /usr/local | grep libspectrum > .tar_files + sudo tar -cvf \ + libspectrum-installed-macos.tar \ + -C /usr/local/ -T.tar_files + + - name: (15) Upload generated tar file + uses: actions/upload-artifact@v3 + with: + name: libspectrum-installed-macos-${{ inputs.key }} + path: | + libspectrum-installed-macos.tar + + - name: (16) Finish + run: | + echo "🍏 Finishing with status ${{ job.status }}." |