[latex3-commits] [git/LaTeX3-latex3-latex2e] main: Import GH Action script from develop (c2a4bdb1)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Aug 27 14:30:08 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : main
Link       : https://github.com/latex3/latex2e/commit/c2a4bdb1ff5ddb3f9c434f8a568035d1b84cb7ec

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

commit c2a4bdb1ff5ddb3f9c434f8a568035d1b84cb7ec
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Aug 27 13:30:08 2021 +0100

    Import GH Action script from develop


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

c2a4bdb1ff5ddb3f9c434f8a568035d1b84cb7ec
 .github/workflows/main.yaml | 245 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 245 insertions(+)

diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
new file mode 100644
index 00000000..3a203882
--- /dev/null
+++ b/.github/workflows/main.yaml
@@ -0,0 +1,245 @@
+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: "Tests: base"
+            l3build_cmd: cd base && l3build check -q --show-log-on-error
+            artifact_name: testfiles
+          - name: "Tests: required"
+            l3build_cmd: cd required && l3build check -q --show-log-on-error
+            artifact_name: testfiles
+          - name: "Documentation"
+            l3build_cmd: l3build doc -q -H --show-log-on-error
+            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 Ghostscript for dvips and XeTeX tests.
+      - run: sudo apt-get install ghostscript
+      - 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
+            luatex
+            #
+            # The test framework itself
+            l3build
+            #
+            # Required to build plain and LaTeX formats:
+            # TeX90 plain for unpacking, pdfLaTeX, LuaLaTeX and XeTeX for tests
+            cm
+            etex
+            knuth-lib
+            latex-bin
+            luahbtex
+            tex
+            tex-ini-files
+            unicode-data
+            xetex
+            #
+            # Assuming a 'basic' font set up, metafont is required to avoid
+            # warnings with some packages and errors with others
+            metafont
+            mfware
+            texlive-scripts
+            #
+            # Contrib packages
+            amsfonts   
+            ec         
+            fontspec   
+            hyperref   
+            iftex      
+            kvoptions  
+            oberdiek   
+            pdftexcmds 
+            lh         
+            lualibs    
+            luaotfload 
+            tex-gyre   
+            stringenc  
+            url
+            #
+            # special testing for firstaid
+            bidi         
+            bigfoot      
+            ncctools     
+            dinbrief     
+            everyshi     
+            filehook     
+            pgf          
+            pgfmorepages 
+            ulem         
+            varwidth
+            #
+            # Additional support for typesetting
+            alphalph     
+            amscls       
+            atbegshi     
+            atveryend    
+            auxhook      
+            babel-german 
+            bigintcalc   
+            bitset       
+            bookmark     
+            booktabs     
+            cbfonts      
+            cm-super     
+            colortbl     
+            csquotes     
+            dvips        
+            enumitem     
+            epstopdf     
+            epstopdf-pkg 
+            etexcmds     
+            etoolbox     
+            fancyvrb     
+            fc           
+            geometry     
+            gettitlestring 
+            graphics-def 
+            helvetic     
+            hologo       
+            hycolor      
+            imakeidx     
+            infwarerr    
+            intcalc      
+            kvdefinekeys 
+            kvoptions    
+            kvsetkeys    
+            letltxmacro  
+            ltxcmds      
+            ly1          
+            makeindex    
+            mflogo       
+            palatino     
+            pdfescape    
+            pl           
+            psnfss       
+            refcount     
+            rerunfilecheck 
+            sauter       
+            times        
+            titlesec     
+            underscore   
+            uniquecounter 
+            vntex        
+            wasy         
+            wsuipa       
+            xkeyval      
+            zref
+      - 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.