ci.yml (9151B)
1 name: CI 2 3 on: 4 push: 5 branches: [ main, dev ] 6 pull_request: 7 branches: [ main ] 8 9 # Allows to run this workflow manually from the Actions tab 10 workflow_dispatch: 11 12 jobs: 13 build: 14 runs-on: ubuntu-latest 15 timeout-minutes: 60 16 strategy: 17 fail-fast: false 18 matrix: 19 # racket: ['6.9', '6.10', '6.10.1', '6.11', '6.12', '7.0', '7.1', '7.2', '7.3', '7.4', '7.5', '7.6', '7.7', '7.8', '7.9', '8.0'] 20 racket: ['7.3'] 21 racket_cs: [0] 22 # include: 23 # - racket: '8.0' 24 # racket_cs: 1 25 env: 26 # RACKET_DIR is an argument to install-racket.sh 27 RACKET_VERSION: "${{ matrix.racket }}" 28 RACKET_CS: "${{ matrix.racket_cs }}" 29 DEPLOY: true 30 steps: 31 - uses: actions/checkout@v2 32 - name: Install LaTeX 33 # texlive-latex3 on 12.04, texlive-latex-recommended on more recent versions of Ubuntu. 34 # Some version (16.04?) needed these packages: pgf texlive-latex3 latex-xcolor 35 run: sudo apt install -y texlive-latex-base texlive-fonts-extra texlive-fonts-recommended texlive-latex-extra texlive-latex-recommended ghostscript 36 - name: Install Zip 37 # texlive-latex3 on 12.04, texlive-latex-recommended on more recent versions of Ubuntu. 38 # Some version (16.04?) needed these packages: pgf texlive-latex3 latex-xcolor 39 run: sudo apt install -y zip 40 - name: Add to $PATH 41 run: | 42 printf %s\\n "$HOME/.racket/bin" >> "$GITHUB_PATH" 43 - name: Print environment variables 44 run: | 45 echo "matrix.racket ${{ matrix.racket }}" 46 echo "matrix.racket_cs ${{ matrix.racket_cs }}" 47 echo HOME="$HOME" 48 echo PATH="$PATH" 49 echo RACKET_VERSION="$RACKET_VERSION" 50 echo RACKET_CS="$RACKET_CS" 51 echo DEPLOY="$DEPLOY" 52 echo GITHUB_WORSPACE="$GITHUB_WORKSPACE" 53 - name: Install Racket 54 run: | 55 export RACKET_DIR="$HOME/.racket" 56 curl -L https://raw.githubusercontent.com/greghendershott/travis-racket/master/install-racket.sh | bash 57 - name: Install Scribble 58 # Install custom version of scribble-lib which includes fixes for bibted-related problems which have not merged upstream yet. Also includes extended support for highlighting Racket code. 59 run: | 60 #raco pkg remove --force scribble-lib || true 61 #SCOPE='--scope installation' 62 #SCOPE='--scope user' 63 SCOPE='' 64 if test "$RACKET_VERSION" = "6.9"; then 65 raco pkg install $SCOPE --force --name scribble-lib https://github.com/jsmaniac/hyper-literate.git?path=scribble-lib#my-changes 66 elif test "$RACKET_VERSION" = "6.10" || test "$RACKET_VERSION" = "6.10.1"; then 67 raco pkg install $SCOPE --force --name scribble-lib https://github.com/jsmaniac/hyper-literate.git?path=scribble-lib#my-changes-v6.10 68 elif test "$RACKET_VERSION" = "6.11" \ 69 || test "$RACKET_VERSION" = "6.12" \ 70 || test "$RACKET_VERSION" = "7.0" \ 71 || test "$RACKET_VERSION" = "7.1" \ 72 || test "$RACKET_VERSION" = "7.2" \ 73 || test "$RACKET_VERSION" = "7.3" \ 74 || test "$RACKET_VERSION" = "7.4" \ 75 || test "$RACKET_VERSION" = "7.5" \ 76 || test "$RACKET_VERSION" = "7.6" \ 77 || test "$RACKET_VERSION" = "7.7" \ 78 || test "$RACKET_VERSION" = "7.8" \ 79 || test "$RACKET_VERSION" = "7.9" \ 80 || test "$RACKET_VERSION" = "8.0" \ 81 ; then 82 raco pkg install $SCOPE --force --name scribble-lib https://github.com/jsmaniac/hyper-literate.git?path=scribble-lib#my-changes-v"$RACKET_VERSION" 83 else 84 raco pkg install $SCOPE --force --name scribble-lib https://github.com/jsmaniac/hyper-literate.git?path=scribble-lib#my-changes-v8.0 85 fi 86 - name: Install older version of fancy-app for Racket 6.9 and 6.10 87 run: | 88 if test "$RACKET_VERSION" = "6.9" || test "$RACKET_VERSION" = "6.10"; then 89 raco pkg install --deps search-auto -j 2 'https://github.com/samth/fancy-app.git#d137c55d5d29f4bc0dd2c8f316dc30521c1cb592' 90 fi 91 - name: Install older version of turnstile (macrotypes) for Racket < 7.0 92 run: | 93 if test "$RACKET_VERSION" = "6.9" || test "$RACKET_VERSION" = "6.10" || test "$RACKET_VERSION" = "6.10.1" || test "$RACKET_VERSION" = "6.11" || test "$RACKET_VERSION" = "6.12"; then 94 raco pkg install --deps search-auto -j 2 'https://github.com/stchang/macrotypes.git#e81f9abc5b88a7c30d14d8591038679c1db013c0' 95 sed -i -e '/###REMOVE_BEFORE_7_0###/d' info.rkt 96 fi 97 - name: Install some of the other dependencies (might not be necessary) 98 run: | 99 raco pkg install --deps search-auto -j 2 type-expander # Start installing stuff, continue later to avoid timeout. 100 raco pkg install --deps search-auto -j 2 phc-adt # Start installing stuff, continue later to avoid timeout. 101 - name: Install extra Latex packages 102 run: | 103 latex_home=$(kpsewhich -var-value=TEXMFHOME) 104 curl -L -o newunicodechar.ins http://mirrors.ctan.org/macros/latex/contrib/newunicodechar/newunicodechar.ins 105 curl -L -o newunicodechar.dtx http://mirrors.ctan.org/macros/latex/contrib/newunicodechar/newunicodechar.dtx 106 latex newunicodechar.ins 107 mkdir -p "$latex_home/tex/latex/newunicodechar" 108 mv newunicodechar.sty "$latex_home/tex/latex/newunicodechar" 109 curl -L -o mathpartir.dtx http://mirrors.ctan.org/macros/latex/contrib/mathpartir/mathpartir.dtx 110 curl -L -o mathpartir.ins http://mirrors.ctan.org/macros/latex/contrib/mathpartir/mathpartir.ins 111 latex mathpartir.ins 112 mkdir -p "$latex_home/tex/latex/mathpartir" 113 mv mathpartir.sty "$latex_home/tex/latex/mathpartir" 114 - name: Install the Racket package 115 run: raco pkg install --deps search-auto -j 2 116 - name: Test the Racket package 117 run: raco test -x -p "$(basename "$GITHUB_WORKSPACE")" 118 - name: (Re?)Build the Racket package 119 run: raco setup --check-pkg-deps --no-zo --no-launcher --no-install --no-post-install --no-docs --pkgs "$(basename "$GITHUB_WORKSPACE")" 120 - name: Generate docs 121 #run: raco scribble ++main-xref-in --dest doc/phc-thesis --html --dest-name index --redirect-main http://download.racket-lang.org/releases/7.3/doc/ --redirect https://docs.racket-lang.org/local-redirect/index.html scribblings/phc-thesis.scrbl > html.log 2>&1 || (cat html.log && exit 1) 122 run: | 123 for i in `seq 100`; do (df -h; free -m; find doc) || true; sleep 3; done & 124 raco scribble ++main-xref-in --dest doc/phc-thesis --html --dest-name index --redirect-main http://download.racket-lang.org/releases/7.3/doc/ --redirect https://docs.racket-lang.org/local-redirect/index.html scribblings/phc-thesis.scrbl 125 echo DONE 126 - name: Generate PDF 127 run: make 128 - name: Render MathJax offline 129 run: | 130 # Install nvm and node: 131 curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash 132 export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" 133 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 134 echo HOME 135 ls -la ~/ || true 136 echo NVM 137 ls -la ~/.nvm || true 138 source ~/.nvm/nvm.sh 139 # Install node 140 nvm install v8.1 # works with v8.1.4 141 # Install mathjax-node 142 npm install mathjax-node@1.2.0 143 # Patch mathjax-node 144 patch -p1 < qaligned.patch 145 patch -p1 < MathJax-bfit.patch 146 # Run mathjax offline 147 node < run-mathjax-offline.node.js 148 mv doc/phc-thesis/index2.html doc/phc-thesis/index.html 149 - name: Patch docs 150 run: | 151 ./fixlinks.sh 152 #find doc -name '*.html' -type f -print0 | xargs -0 ls -ld 153 #find doc -name '*.html' -type f -print0 | xargs -0 sed -i -e 's|https://download\.racket-lang\.org/docs/6\.9/html/|https://docs.racket-lang.org/|g' 154 #find doc -name '*.html' -type f -print0 | xargs -0 ls -ld 155 - name: Create .zip archive 156 run: | 157 zipfile_folder_name="$(racket -e '(begin (require phc-thesis/scribblings/util) (display (version-text "phc-thesis-" "")))')" 158 mv doc "${zipfile_folder_name}" 159 zip -r "${zipfile_folder_name}.zip" "${zipfile_folder_name}" 160 mv "${zipfile_folder_name}" doc 161 mv "${zipfile_folder_name}.zip" doc/ 162 # - name: Deploy 163 # run: if test "x${DEPLOY:-}" = "xtrue"; then sh ./auto-push-gh-pages.sh; fi 164 # These two steps replace the custom deploy script ./auto-push-gh-pages.sh. 165 - name: Use the documentation as-is for gh-pages by specifying .nojekyll 166 run: touch doc/.nojekyll 167 - name: Deploy 168 uses: JamesIves/github-pages-deploy-action@4.1.4 169 with: 170 branch: gh-pages 171 folder: doc 172 commit-message: "Auto-publish to gh-pages"