McCLIM icon indicating copy to clipboard operation
McCLIM copied to clipboard

CI Strategy

Open scymtym opened this issue 5 years ago • 1 comments

Hi @nsrahmad, I have been experimenting with CI configurations for McCLIM for some time.

Since you took charge, maybe you can use some of my findings. I normally automatically generate these configurations, so things looks a bit unwieldy, but maybe you can use a thing or two. Below is the generated configuration for GitHub actions (which is a bit lacking regarding reports such as sloccount, warnings and coverage compare to Jenkins):

  cl-mcclim_master-with-doc:
    runs-on: ubuntu-18.04
    needs: [cl-test_report_future,cl-launch_master,quicklisp_current,sbcl_sbcl-2_0_0-with-doc,cl-opticl_master,cl-clx_master]
    steps:
      - name: install-platform-dependencies
        run: |
          export WORKSPACE=$(pwd)
          DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update \
              && DEBIAN_FRONTEND=noninteractive sudo apt-get -qq --assume-yes install \
                fig2dev texlive-font-utils texlive texlive-latex-extra texinfo  \
                make fonts-dejavu git gzip bzip2 unzip unp wget sloccount tar



      - name: git.repository
        run: |
          export WORKSPACE=$(pwd)
          git clone -b master https://github.com/mcclim/mcclim.git .


      - name: download-artifact-cl-clx@master
        uses: actions/download-artifact@v1
        with:
          name: cl-clx@master
          path: upstream
      - name: download-artifact-cl-opticl@master
        uses: actions/download-artifact@v1
        with:
          name: cl-opticl@master
          path: upstream
      - name: [email protected]
        uses: actions/download-artifact@v1
        with:
          name: [email protected]
          path: upstream
      - name: download-artifact-quicklisp@current
        uses: actions/download-artifact@v1
        with:
          name: quicklisp@current
          path: upstream
      - name: download-artifact-cl-launch@master
        uses: actions/download-artifact@v1
        with:
          name: cl-launch@master
          path: upstream
      - name: download-artifact-cl-test.report@future
        uses: actions/download-artifact@v1
        with:
          name: cl-test.report@future
          path: upstream
      - name: extract-upstream-artiacts
        run: |
          export WORKSPACE=$(pwd)
          cd upstream
          find . -name '*.tar.gz' -exec tar -xzf '{}' \;

      - name: common-lisp.shell
        run: |
          export WORKSPACE=$(pwd)
          # Set up environment
          export "ASDF_OUTPUT_TRANSLATIONS=/:${WORKSPACE}/fasl-cache/"


          # Flush FASL cache if its contents is no longer compatible with
          # the implementation
          if ! upstream/install/bin/cl-launch                                                                                    \
            --lisp sbcl                                                                        \
            --wrap 'SBCL_OPTIONS="--dynamic-space-size 4GB ${SBCL_OPTIONS}"' \
                 '(let ((file (first (directory "'''"${WORKSPACE}/fasl-cache"'''/**/*.fasl"))))
            (when file
              (handler-case
                  (sb-fasl::check-fasl-header (open file :element-type (quote (unsigned-byte 8))))
                (sb-fasl::invalid-fasl-version ()
                  (uiop:quit 1)))))' ; then
            echo "FASL cache in ${WORKSPACE}/fasl-cache is not usable, deleting."
            rm -rf "${WORKSPACE}/fasl-cache"
          fi

          # Ensure dependencies
          upstream/install/bin/cl-launch                                                                                    \
            --lisp sbcl                                                                        \
            --wrap 'SBCL_OPTIONS="--dynamic-space-size 4GB ${SBCL_OPTIONS}"' \
            -S "(:source-registry                                                 \
            (:tree \"$(pwd)\")                                             \
            (:tree \"$(pwd)/upstream/share/common-lisp/source\") \
            :ignore-inherited-configuration)" \
            -s alexandria -s trivial-gray-streams -s closer-mop -s spatial-trees -s flexichain -s bordeaux-threads -s trivial-garbage -s trivial-features -s babel -s sb-introspect -s opticl -s swank -s fiveam -s zpb-ttf -s cl-vectors -s cl-paths-ttf -s cl-aa -s cl-pdf -s flexi-streams -s clx -s cl-unicode -s cl-freetype2 -s mcclim-fontconfig -s mcclim-harfbuzz -s uiop -s cl-fad -s sb-posix

          # Compile
          SBCL_HOME=$(pwd)/upstream/install/lib/sbcl upstream/install/bin/sbcl \
            --noinform --lose-on-corruption --dynamic-space-size 4GB           \
            --no-userinit --disable-debugger --non-interactive                  \
              --eval '(require :asdf)' \
            --eval "(asdf:initialize-source-registry (quote (:source-registry                                                 \
            (:tree \"$(pwd)\")                                             \
            (:tree \"$(pwd)/upstream/share/common-lisp/source\") \
            :ignore-inherited-configuration)))" \
            --eval '(require :sb-cover)' \
            --eval '(declaim (optimize sb-cover:store-coverage-data))' \
            --eval '(handler-bind
              ((style-warning
                (lambda (condition)
                  (when (search "does not have a presentation metaclass"
                                (princ-to-string condition))
                    (muffle-warning)))))
            (flet ((compile-system (system)
                   (asdf:load-system system :force t)))
            (map nil (function compile-system) (list "clim-lisp" "automaton" "persistent" "mcclim-layouts" "clim-basic" "clim-core" "esa-mcclim" "mcclim-bitmaps" "conditional-commands" "mcclim-fonts" "drei-mcclim" "clim" "mcclim-franz" "mcclim-layouts/tab" "mcclim-fonts/truetype" "mcclim-render" "mcclim-backend-common" "mcclim-raster-image" "clim-postscript-font" "clim-postscript" "clim-pdf" "mcclim-null" "mcclim-bezier/core" "mcclim-clx" "mcclim-bezier/clx" "mcclim-bezier" "mcclim/extensions" "mcclim-fonts/clx-truetype" "mcclim-clx/truetype" "mcclim-fonts/clx-freetype" "mcclim-clx/freetype" "mcclim-clx-fb" "mcclim/looks" "mcclim" "clim-examples" "clim-examples/superapp" "mcclim-tree-with-cross-edges" "slim" "mcclim/test-util" "scigraph/dwim" "scigraph" "clouseau" "clim-debugger" "clim-listener" "functional-geometry" ))))' \
           \
            --quit

          # Execute tests
          rm -f test-results-*.xml

          upstream/install/bin/cl-launch                                                                                    \
            --lisp sbcl                                                                        \
            --wrap 'SBCL_OPTIONS="--dynamic-space-size 4GB ${SBCL_OPTIONS}"' \
            -S "(:source-registry                                                 \
            (:tree \"$(pwd)\")                                             \
            (:tree \"$(pwd)/upstream/share/common-lisp/source\") \
            :ignore-inherited-configuration)" \
            -s clim-lisp -s automaton -s persistent -s mcclim-layouts -s clim-basic -s clim-core -s esa-mcclim -s mcclim-bitmaps -s conditional-commands -s mcclim-fonts -s drei-mcclim -s clim -s mcclim-franz -s mcclim-layouts/tab -s mcclim-fonts/truetype -s mcclim-render -s mcclim-backend-common -s mcclim-raster-image -s clim-postscript-font -s clim-postscript -s clim-pdf -s mcclim-null -s mcclim-bezier/core -s mcclim-clx -s mcclim-bezier/clx -s mcclim-bezier -s mcclim/extensions -s mcclim-fonts/clx-truetype -s mcclim-clx/truetype -s mcclim-fonts/clx-freetype -s mcclim-clx/freetype -s mcclim-clx-fb -s mcclim/looks -s mcclim -s clim-examples -s clim-examples/superapp -s mcclim-tree-with-cross-edges -s slim -s mcclim/test-util -s scigraph/dwim -s scigraph -s clouseau -s clim-debugger -s clim-listener -s functional-geometry -s sb-cover -s test.report.adapter-fiveam -s test.report.report-junit                                   \
            '(progn (test.report.adapter.fiveam:hook-into-run)
          (mapc (function asdf:test-system) (list "drei-mcclim/test" "mcclim-backend-common/test" "mcclim/test" "clim-pdf/test" "clim-postscript/test" "mcclim-raster-image/test" "clouseau/test" ))
          (sb-cover:report "coverage-report/")
          )'



          (
            cd "Documentation/Manual/Texinfo"
            make distclean all # TODO proper make invocation
          )
          (
            cd "Documentation/Guided-Tour"
            make clean "guided-tour.pdf"
          )
          (
            cd "Documentation/Specification"
            make
          )



      - name: common-lisp-shared.archive-source-code
        run: |
          export WORKSPACE=$(pwd)
          # Package source code (remove archive from previous build first
          rm -f "cl-mcclim-master-with-doc.tar.gz"
          temp=$(mktemp -u).tar.gz
          tar --exclude .dir-locals.el --exclude .editorconfig --exclude .dir-locals.el --exclude .editorconfig --exclude sloccount.sc --exclude .dir-locals.el --exclude .editorconfig --exclude .dir-locals.el --exclude .editorconfig --exclude test-results-*.xml --exclude upstream --exclude build --exclude .git --exclude .gitignore --exclude .gitattributes --exclude .svn --exclude .bzr --exclude .project --exclude .idea --exclude upstream --exclude build --exclude .git --exclude .gitignore --exclude .gitattributes --exclude .svn --exclude .bzr --exclude .project --exclude .idea --exclude upstream --exclude build --exclude .git --exclude .gitignore --exclude .gitattributes --exclude .svn --exclude .bzr --exclude .project --exclude .idea --exclude install --exclude upstream --exclude build --exclude .git --exclude .gitignore --exclude .gitattributes --exclude .svn --exclude .bzr --exclude .project --exclude .idea --exclude fasl-cache                              \
            --transform 's#^\.\(.*\)#cl-mcclim-master-with-doc\1#' \
            -czf "${temp}"                                               \
            .
          mv "${temp}" "cl-mcclim-master-with-doc.tar.gz"


      - name: gather-artifacts
        run: |
          export WORKSPACE=$(pwd)
          mkdir -p artifacts
          mv -v cl-mcclim-master-with-doc.tar.gz Documentation/Manual/Texinfo/mcclim.info Documentation/Manual/Texinfo/mcclim.pdf Documentation/Manual/Texinfo/mcclim.html Documentation/Manual/Texinfo/figures/*.png Documentation/Guided-Tour/guided-tour.pdf Documentation/Specification/clim.pdf artifacts/

      - name: upload-artifact-cl-mcclim@master-with-doc
        uses: actions/upload-artifact@v1
        with:
          name: cl-mcclim@master-with-doc
          path: artifacts

scymtym avatar Jul 14 '20 08:07 scymtym

I wonder if using roswell to run things is a way to go. The quality of roswell is discussable.

dkochmanski avatar Jul 14 '20 09:07 dkochmanski