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/e656b2315faa43d24eaafd61e746acda2b8b00f9/ commit e656b2315faa43d24eaafd61e746acda2b8b00f9 Author: Miroslav Ďurčík / Arki55 <mir...@gm...> AuthorDate: Wed Feb 15 23:35:49 2023 +0100 arki55/features/T9-github-build-checks (libspectrum) build: Improving linux build&test workflow. - Moved generic logic for Linux build into a subfile - Refactored to allow configuration of every switch in ./configure regarding supported optional libraries (gzip, gcrypt, audiofile, bzip, fake glib) - Configured 6 build setups with fake glib and 6 build setups without it. No need to test every possible combination of configure options. - After build also make check will test the lib with available unittests. If they fail then all tests will be printed out. --- .github/workflows/build_linux.yml | 204 +++++++++++++++------------- .github/workflows/build_linux_fake_glib.yml | 70 ---------- .github/workflows/build_linux_sub.yml | 174 ++++++++++++++++++++++++ 3 files changed, 281 insertions(+), 167 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 2f025a8..4520a4c 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -1,110 +1,120 @@ -name: Libspectrum for Linux (1) -run-name: Build and test Libspectrum for Linux (1) [ all libs, real glib ] / ${{ github.actor }} / - -on: - # Executed upon each commit pushed, merge commit in PR - push: - pull_request: - # Called from fuse app, fuse utils repos - workflow_call: - inputs: - path: - type: string - required: false - default: '.' - branch: - type: string - required: false - # Repo is taken from var.LIBSPECTRUM_REPO, cannot be passed as input. +name: Libspectrum for Linux +run-name: Build and test Libspectrum for Linux / ${{ github.actor }} / +# Executed upon each commit pushed, merge commit in PR +on: [push, pull_request] + jobs: - build: - name: Build & Test - runs-on: ubuntu-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" + ################# + ### REAL GLIB ### + ################# + + # 1. Default = all libs enabled, fake glib no + default: + name: "Libspectrum + all libs (Linux, real glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "default" + + # 2. Without zlib (real glib) + no-zlib: + name: "Libspectrum w/o zlib (Linux, real glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-zlib" + use_zlib: false - - name: (2) Check out repository code - uses: actions/checkout@v3 - with: - repository: ${{ env.LIBSPECTRUM_REPO }} - ref: ${{ env.LIBSPECTRUM_BRANCH }} - path: ${{ env.LIBSPECTRUM_PATH }} + # 3. Without bzip2 (real glib) + no-bzip2: + name: "Libspectrum w/o bzip2 (Linux, real glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-bzip2" + use_bzip2: false - - name: (3) Install dependencies - run: | - pwd - ls -la - echo "Installing dependencies .." - sudo apt install -y libaudiofile-dev + # 4. Without libgcrypt (real glib) + no-libgcrypt: + name: "Libspectrum w/o libgcrypt (Linux, real glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-libgcrypt" + use_libgcrypt: false - - name: (4) Autogen.sh - run: | - echo "Running autogen.sh .." - ./autogen.sh + # 5. Without libaudiofile (real glib) + no-libaudiofile: + name: "Libspectrum w/o libaudiofile (Linux, real glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-libaudiofile" + use_libaudiofile: false - - name: (5) Configure for linux (real glib) - run: | - echo "Running configure .." - ./configure | tee ./configure.out + # 6. Without all libs (real glib) + no-libs: + name: "Libspectrum w/o all libs (Linux, real glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-libs" + use_zlib: false + use_bzip2: false + use_libgcrypt: false + use_libaudiofile: false - - name: (6) Verify output from configure - run: | - .github/scripts/in_config.sh "libspectrum is ready to be compiled" - .github/scripts/in_config.sh "zlib support: yes" - .github/scripts/in_config.sh "bzip2 support: yes" - .github/scripts/in_config.sh "libgcrypt support: yes" - .github/scripts/in_config.sh "libaudiofile support: yes" - .github/scripts/in_config.sh "Internal GLib replacement: no" + ################# + ### FAKE GLIB ### + ################# - - name: (7) Make - run: | - echo "Running make .." - make + # 7. Default = all libs enabled, fake glib yes + default-fake-glib: + name: "Libspectrum + all libs (Linux, fake glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "default-fake-glib" + use_fake_glib: true - - name: (8) Install - run: | - echo "Running make install .." - sudo make install + # 8. Without zlib (fake glib) + no-zlib-fake-glib: + name: "Libspectrum w/o zlib (Linux, fake glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-zlib-fake-glib" + use_zlib: false + use_fake_glib: true - - name: (9) Run tests - run: | - echo "Bulding and running tests .." - make check + # 9. Without bzip2 (fake glib) + no-bzip2-fake-glib: + name: "Libspectrum w/o bzip2 (Linux, fake glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-bzip2-fake-glib" + use_bzip2: false + use_fake_glib: true - - name: (10) Upload generated files - # Need to pack files to maintain permissions (+x mainly) - run: | - tar -cvf \ - libspectrum-compiled-linux.tar \ - --exclude=".git" "libspectrum-compiled-linux.tar" \ - --ignore-failed-read \ - . + # 10. Without libgcrypt (fake glib) + no-libgcrypt-fake-glib: + name: "Libspectrum w/o libgcrypt (Linux, fake glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-libgcrypt-fake-glib" + use_libgcrypt: false + use_fake_glib: true - - uses: actions/upload-artifact@v3 - with: - name: libspectrum-compiled-linux - path: | - libspectrum-compiled-linux.tar + # 11. Without libaudiofile (fake glib) + no-libaudiofile-fake-glib: + name: "Libspectrum w/o libaudiofile (Linux, fake glib)" + uses: ./.github/workflows/build_linux_sub.yml + with: + key: "no-libaudiofile-fake-glib" + use_libaudiofile: false + use_fake_glib: true - - name: (11) Finish - run: | - echo "🍏 Finishing with status ${{ job.status }}." + # 12. Without all libs (fake glib) + no-libs-fake-glib: + name: "Libspectrum w/o all libs (Linux, fake glib)" + uses: ./.github/workflows/build_linux_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_linux_fake_glib.yml b/.github/workflows/build_linux_fake_glib.yml deleted file mode 100644 index 70b9967..0000000 --- a/.github/workflows/build_linux_fake_glib.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Libspectrum for Linux (2) -run-name: Build and test Libspectrum for Linux (2) [ all libs, fake glib ] / ${{ github.actor }} / - -# Executed upon each commit pushed, merge commit in PR -on: [push, pull_request] - -jobs: - build: - name: Build & Test - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: (1) Prepare git - run: | - echo "Not needed in this build" - - - name: (2) Check out repository code - uses: actions/checkout@v3 - - - name: (3) Install dependencies - run: | - echo "Installing dependencies .." - sudo apt install -y libaudiofile-dev - - - name: (4) Autogen.sh - run: | - echo "Running autogen.sh .." - ./autogen.sh - - - name: (5) Configure for linux (fake glib) - run: | - echo "Running configure (fake glib) .." - ./configure --with-fake-glib | tee ./configure.out - - - name: (6) Verify output from configure - run: | - .github/scripts/in_config.sh "libspectrum is ready to be compiled" - .github/scripts/in_config.sh "zlib support: yes" - .github/scripts/in_config.sh "bzip2 support: yes" - .github/scripts/in_config.sh "libgcrypt support: yes" - .github/scripts/in_config.sh "libaudiofile support: yes" - .github/scripts/in_config.sh "Internal GLib replacement: yes" - - - name: (7) Make - run: | - echo "Running make .." - make - - - name: (8) Install (+sudo) - run: | - echo "Running make install .." - sudo make install - - - name: (9) Run tests - run: | - echo "Bulding and running tests .." - make check - - - name: (10) Upload generated files - uses: actions/upload-artifact@v3 - with: - name: libspectrum-linux-fake-glib - path: | - doc/libspectrum.3 - libspectrum.h - libspectrum.pc - - - name: (11) Finish - run: | - echo "🍏 Finishing with status ${{ job.status }}." diff --git a/.github/workflows/build_linux_sub.yml b/.github/workflows/build_linux_sub.yml new file mode 100644 index 0000000..85500ed --- /dev/null +++ b/.github/workflows/build_linux_sub.yml @@ -0,0 +1,174 @@ +name: Libspectrum for Linux +run-name: Build and test Libspectrum for Linux / ${{ 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: ubuntu-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: | + pwd + ls -la + echo "Installing dependencies .." + sudo apt install -y \ + libaudiofile-dev \ + libbz2-dev \ + libgcrypt-dev \ + libglib2.0-dev \ + libxml2-dev + + - 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 Linux + 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-linux.tar \ + -C /usr/local/ -T.tar_files + + - name: (15) Upload generated tar file + uses: actions/upload-artifact@v3 + with: + name: libspectrum-installed-linux-${{ inputs.key }} + path: | + libspectrum-installed-linux.tar + + - name: (16) Finish + run: | + echo "🍏 Finishing with status ${{ job.status }}." |