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/48b887d8562623bd7cc97ef6534937f18dc20f6f/ commit 48b887d8562623bd7cc97ef6534937f18dc20f6f Author: Miroslav Ďurčík / Arki55 <mir...@gm...> AuthorDate: Wed Feb 15 23:39:08 2023 +0100 arki55/features/T9-github-build-checks (libspectrum) build: Implementing buld & test workflow for platform Windows. - DOne similarly as for Linux before. - Only combinations with fake glib tested. Libspectrum without fake glib not supported under Windows. - Workflows executed on push (commits) and pull requests. - COnfigurable workflow for building library with parameters in reusable build_windows_sub.yml workflow. Will be called from Fuse APP and Fuse utils repos. --- .github/workflows/build_windows.yml | 56 ++++++++ .github/workflows/build_windows_sub.yml | 239 ++++++++++++++++++++++++++++++++ 2 files changed, 295 insertions(+) diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml new file mode 100644 index 0000000..1b84909 --- /dev/null +++ b/.github/workflows/build_windows.yml @@ -0,0 +1,56 @@ +name: Libspectrum for Windows +run-name: Build and test Libspectrum for Windows / ${{ github.actor }} / + +# Executed upon each commit pushed, merge commit in PR +on: [push, pull_request] + +jobs: + # 1. Default = all libs enabled, fake glib is always used + default: + name: "Libspectrum + all libs (Windows)" + uses: ./.github/workflows/build_windows_sub.yml + with: + key: "default" + + # 2. Without zlib + no-zlib: + name: "Libspectrum w/o zlib (Windows)" + uses: ./.github/workflows/build_windows_sub.yml + with: + key: "no-zlib" + use_zlib: false + + # 3. Without bzip2 + no-bzip2: + name: "Libspectrum w/o bzip2 (Windows)" + uses: ./.github/workflows/build_windows_sub.yml + with: + key: "no-bzip2" + use_bzip2: false + + # 4. Without libgcrypt + no-libgcrypt: + name: "Libspectrum w/o libgcrypt (Windows)" + uses: ./.github/workflows/build_windows_sub.yml + with: + key: "no-libgcrypt" + use_libgcrypt: false + + # 5. Without libaudiofile + no-libaudiofile: + name: "Libspectrum w/o libaudiofile (Windows)" + uses: ./.github/workflows/build_windows_sub.yml + with: + key: "no-libaudiofile" + use_libaudiofile: false + + # 6. Without all libs + no-libs: + name: "Libspectrum w/o all libs (Windows)" + uses: ./.github/workflows/build_windows_sub.yml + with: + key: "no-libs" + use_zlib: false + use_bzip2: false + use_libgcrypt: false + use_libaudiofile: false diff --git a/.github/workflows/build_windows_sub.yml b/.github/workflows/build_windows_sub.yml new file mode 100644 index 0000000..fee857c --- /dev/null +++ b/.github/workflows/build_windows_sub.yml @@ -0,0 +1,239 @@ +name: Libspectrum for Windows +run-name: Build and test Libspectrum for Windows / ${{ 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 + # Repo is taken from var.LIBSPECTRUM_REPO, cannot be passed as input. + +jobs: + build: + name: Build & Test + runs-on: windows-latest + timeout-minutes: 15 + defaults: + run: + shell: bash.exe --login --norc -eo pipefail -o igncr '{0}' + working-directory: ${{ inputs.path || '.' }} + env: + CYGWIN_NOWINPATH: 1 + + # Custom build libraries + CPPFLAGS: "-I/usr/local/i686-w64-mingw32/include" + LDFLAGS: "-L/usr/local/i686-w64-mingw32/lib" + PKG_CONFIG_LIBDIR: "/usr/local/i686-w64-mingw32/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" + # Small help when copying dlls + CYGWIN_LIBDIR: "/usr/i686-w64-mingw32/sys-root/mingw/bin/" + + # 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: | + cd ${GITHUB_WORKSPACE} + + echo "Adjust autocrlf in git.." + git config --global core.autocrlf input + + 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' }}" + + - 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 Cygwin packages + id: cygwin-cache-load + uses: actions/cache/restore@v3 + with: + path: | + C:\cygwin-packages + key: cygwin-packages-libspectrum-1 + + - name: (4) Install Cygwin (32 bit) with libs + uses: cygwin/cygwin-install-action@master + with: + platform: x86 + packages: | + audiofile \ + autoconf \ + automake \ + bison \ + flex \ + gcc-core \ + gcc-g++ \ + gettext-devel \ + libtool \ + libaudiofile-devel \ + make \ + mingw64-i686-audiofile \ + mingw64-i686-bzip2 \ + mingw64-i686-gcc-core \ + mingw64-i686-gcc-g++ \ + mingw64-i686-libgcrypt \ + mingw64-i686-libgpg-error \ + mingw64-i686-libpng \ + mingw64-i686-win-iconv \ + mingw64-i686-winpthread \ + mingw64-i686-zlib \ + pkg-config + # All libs are always installed to have just one cache key + + - name: (5) Save Cygwin packages + id: cygwin-cache-save + if: steps.cygwin-cache-load.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: | + C:\cygwin-packages + key: cygwin-packages-libspectrum-1 + + - name: (6) Autogen.sh + run: | + cd ${GITHUB_WORKSPACE} + + echo "Running autogen.sh .." + ./autogen.sh + + - name: (7) Configure for Windows (fake glib) + run: | + cd ${GITHUB_WORKSPACE} + + echo "Running configure .." + ./configure \ + --build=i686-pc-cygwin \ + --host=i686-w64-mingw32 \ + --prefix=/usr/local/i686-w64-mingw32 \ + --disable-static \ + --with-fake-glib \ + ${{ inputs.use_zlib == false && '--without-zlib' || '' }} \ + ${{ inputs.use_bzip2 == false && '--without-bzip2' || '' }} \ + ${{ inputs.use_libgcrypt == false && '--without-libgcrypt' || '' }} \ + ${{ inputs.use_libaudiofile == false && '--without-libaudiofile' || '' }} \ + | tee ./configure.out + + - name: (8) Verify output from configure + run: | + cd ${GITHUB_WORKSPACE} + + .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: yes" + + - name: (9) Make + run: | + cd ${GITHUB_WORKSPACE} + + echo "Running make .." + make + + - name: (10) Install + run: | + cd ${GITHUB_WORKSPACE} + + echo "Running make install-strip .." + make install-strip + + - name: (11) Copy dependency dlls + run: | + cd ${GITHUB_WORKSPACE} + + echo "Copying mandatory dependency dlls.." + cp ${CYGWIN_LIBDIR}libgcc_s_sjlj-1.dll . + cp ${CYGWIN_LIBDIR}libwinpthread-1.dll . + cp ${CYGWIN_LIBDIR}libgpg-error-0.dll . + cp ${CYGWIN_LIBDIR}libstdc++-6.dll . + + echo "Copying optional dependency dlls.." + ${{ inputs.use_zlib && 'cp ${CYGWIN_LIBDIR}zlib1.dll .' || ''}} + ${{ inputs.use_bzip2 && 'cp ${CYGWIN_LIBDIR}libbz2-1.dll .' || ''}} + ${{ inputs.use_libgcrypt && 'cp ${CYGWIN_LIBDIR}libgcrypt-20.dll .' || ''}} + ${{ inputs.use_libaudiofile && 'cp ${CYGWIN_LIBDIR}libaudiofile-1.dll .' || ''}} + ${{ inputs.use_libaudiofile && 'cp ${CYGWIN_LIBDIR}libFLAC-8.dll .' || ''}} + ${{ inputs.use_libaudiofile && 'cp ${CYGWIN_LIBDIR}libOGG-0.dll .' || ''}} + + echo "Copying own dll.." + cp .libs/libspectrum-9.dll . + + - name: (12) Run tests + id: run-tests + run: | + cd ${GITHUB_WORKSPACE} + + 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.exe + + - name: (14) Pack installed library files + # Need to pack files to maintain permissions + run: | + cd ${GITHUB_WORKSPACE} + + tar -cvf \ + libspectrum-installed-windows.tar \ + -C /usr/local/i686-w64-mingw32/ . + + - name: (15) Upload generated tar file + uses: actions/upload-artifact@v3 + with: + name: libspectrum-installed-windows-${{ inputs.key }} + path: | + libspectrum-installed-windows.tar + + - name: (16) Finish + run: | + echo "🍏 Finishing with status ${{ job.status }}." |