[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Use GitHub Actions (c7aa3b1)

Marcel Fabian Krüger tex at 2krueger.de
Fri Jul 30 20:46:52 CEST 2021


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/c7aa3b166537b23a49afc1629a8833f0a264a221

>---------------------------------------------------------------

commit c7aa3b166537b23a49afc1629a8833f0a264a221
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Fri Jul 30 20:46:52 2021 +0200

    Use GitHub Actions


>---------------------------------------------------------------

c7aa3b166537b23a49afc1629a8833f0a264a221
 .github/workflows/main.yaml | 184 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 184 insertions(+)

diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
new file mode 100644
index 0000000..2f9f16a
--- /dev/null
+++ b/.github/workflows/main.yaml
@@ -0,0 +1,184 @@
+name: Automated testing
+
+# Currently we run in two situations:
+on:
+  # Whenever someone pushes to a branch or tag in our repo
+  push:
+  # Whenever a pull request is opened, reopened or gets new commits.
+  pull_request:
+# This implies that for every push to a local branch in our repo for which a
+# pull request is open this runs twice. But it's important to ensure that pull
+# requests get tested even if their branch comes from a fork.
+
+jobs:
+  # The l3build job contains the actual work. We misuse the matrix mechanism to
+  # create three jobs which only differ in minimal elements.
+  l3build:
+    runs-on: ubuntu-20.04
+    strategy:
+      matrix:
+        # include indicates that we want to set explicitly these combinations
+        # and don't want full matrix testing.
+        # "name" is just to make the output more readable.
+        # "l3build_cmd" is the actual command to run
+        # "artifact_name" is which artifact might get generated by this step.
+        # IMPORTANT: artifact_name == "Documentation" is used as a trigger to
+        # generate the artifact from PDF files and not the build directory and
+        # to generate the artifact when the run is successful, not when it fails.
+        include:
+          - name: "Test suite"
+            l3build_cmd: l3build check -q -H --show-log-on-error
+            artifact_name: testfiles
+          - name: "Documentation"
+            l3build_cmd: l3build doc -q -H
+            artifact_name: Documentation
+    name: ${{matrix.name }}
+    steps:
+      # Boilerplate
+      - name: Checkout repository
+        uses: actions/checkout at v2
+      # GitHub Actions don't regenerate the test if the key doesn't change, so
+      # we integrate a random UUID into the key to keep them different.
+      # DO NOT CHANGE THIS
+      - name: Generate unique ID
+        id: get-id
+        run: |
+          echo -n ::set-output name=id::
+          cat /proc/sys/kernel/random/uuid
+      # Actually load the cache. Since we never reuse the key, we need restore-keys
+      # to indicate the prefix of our caches. This loads the newest cache with this
+      # prefix in the key.
+      #
+      # If we want to force regeneration of the cache, increase the number after
+      # *both* instances of "texlive-v"
+      - name: Load cache
+        uses: actions/cache at v2
+        with:
+          path: ~/texlive
+          key: texlive-v0-${{ steps.get-id.outputs.id }}
+          restore-keys: texlive-v0-
+      # We need docutils for our documentation
+      - run: sudo apt-get install python3-docutils
+      - name: Install TeX Live
+        uses: zauguin/install-texlive at v1
+        with:
+          # The following list can be altered to change which TeX Live packages to install.
+          # (Technically no YAML comments can appear in there but all lines starting with #
+          # get removed)
+          # There is no technical reason to list every package on a new line, this is only
+          # done for readablity and diff-friendliness.
+          packages: |
+            # Needed for any use of texlua even if not testing LuaTeX
+            l3build latex latex-bin luatex latex-bin-dev
+            #
+            # Required to build plain and LaTeX formats:
+            # TeX90 plain for unpacking, pdfLaTeX, LuaLaTeX and XeTeX for tests
+            cm etex knuth-lib tex tex-ini-files unicode-data
+            #
+            # various tools / dependencies of other packages
+            ctablestack filehook ifoddpage iftex luatexbase trimspaces oberdiek
+            etoolbox xkeyval ucharcat xstring everyhook svn-prov setspace
+            csquotes everysel
+            #
+            # slices from oberdiek
+            atbegshi atveryend bigintcalc bitset bookmark epstopdf-pkg etexcmds
+            gettitlestring hologo hycolor intcalc kvdefinekeys kvsetkeys
+            letltxmacro ltxcmds luacolor pdfescape pdflscape pdftexcmds refcount
+            rerunfilecheck uniquecounter
+            #
+            # graphics
+            graphics xcolor graphics-def pgf
+            #
+            # fonts support - perhaps take here luaotfload out of the list ...
+            # or is it installed as dependency anyway?
+            fontspec microtype unicode-math ttfutils
+            #
+            # fonts
+            sourcecodepro Asana-Math ebgaramond tex-gyre amsfonts gnu-freefont
+            opensans fira tex-gyre-math junicode lm  lm-math amiri ipaex xits
+            libertine coelacanth fontawesome stix2-otf dejavu luatexko
+            unfonts-core cjk-ko iwona libertinus-fonts fandol cm-unicode noto
+            cuprum gentium-tug
+            #
+            # languages
+            luatexja arabluatex babel babel-english
+            #
+            # math
+            amsmath lualatex-math latex-amsmath-dev
+            #
+            # a few more packages
+            luacode environ adjustbox collectbox ms varwidth geometry url ulem
+            lua-ul
+            #
+            # some packages for the documentation
+            caption fancyvrb hyperref inconsolata listings luatex85 mdwtools
+            metalogo pdfpages pgf-blur standalone tikzducks tikzlings titlesec
+            tocloft tools
+            #
+            # Assuming a 'basic' font set up, metafont is required to avoid
+            # warnings with some packages and errors with others
+            metafont mfware texlive-scripts
+      - name: Run l3build
+        run: ${{ matrix.l3build_cmd }}
+      # Now we create the artifacts: There are two cases where this happens.
+      # 1. If we failed running tests
+      - name: Archive failed test output
+        if: ${{ matrix.artifact_name != 'Documentation' && failure() }}
+        uses: actions/upload-artifact at v2
+        with:
+          name: ${{ matrix.artifact_name }}
+          path: build/test*/*.diff
+          # Decide how long to keep the test output artifact:
+          retention-days: 3
+      # 2. If we succeed building documentation
+      - name: Archive documentation
+        if: ${{ matrix.artifact_name == 'Documentation' && success() }}
+        uses: actions/upload-artifact at v2
+        with:
+          name: ${{ matrix.artifact_name }}
+          path: "**/*.pdf"
+          # Decide how long to keep the test output artifact:
+          retention-days: 21
+  # GitHub automatically informs the initiator of any action about the result, but
+  # we additionally want to keep the latex-commits mailing list informed about
+  # test failures.
+  notifiy:
+    name: Send notifications
+    runs-on: ubuntu-20.04
+    # Run after the `l3build` job in order to be able to react to it's output.
+    needs: l3build
+    # Only run if the tests failed, we don't want to get notifications for every run.
+    # We don't want information for pull requests since for pull requests from local
+    # branches we already send notifications when the branch test fails and pull requests
+    # from forks can't access the username and password secrets required to send mails.
+    if: ${{ failure() && github.event_name != 'pull_request' }}
+    steps:
+      - name: Send mail
+        # The explicit commit hash ensures that this can't be used by dawidd6 as a
+        # backdoor to execute arbitrary code during our runs.
+        uses: dawidd6/action-send-mail at ceb614a2c5737d913f2d2729e2bcc70ad933382b
+        with:
+          # Currently using my (Marcel's) mail server for sending mails.
+          server_address: typesetting.eu
+          server_port: 587
+          # These values can be changed in the repository settings.
+          username: ${{secrets.MAIL_USERNAME}}
+          password: ${{secrets.MAIL_PASSWORD}}
+          # If we want to send notifications to additional addresses, at them here as
+          # a comma separated list.
+          to: latex3-commits at tug.org
+          # The name is arbitrary, but if you want to change the address you need to
+          # coordinate it with the administrator of the mail server to allow the account
+          # to send from the mail address.
+          from: LaTeX CI <github at latex-project.org>
+          priority: high
+          # Determine the subject and body of the mail.
+          subject: "Test failed: ${{github.repository}} (${{github.ref}})"
+          body: |
+            Test failure for ${{github.repository}}
+            -------------------------------------------------------------
+
+            On branch:        ${{github.ref}} (${{github.sha}})
+            Initiated by:     ${{github.actor}}
+            Commit URL:       https://github.com/${{github.repository}}/commit/${{github.sha}}
+            More information: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}





More information about the latex3-commits mailing list.