From c4b2d456a98a55cf5efcd1e30210c227e9ce6252 Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Mon, 27 Sep 2021 13:38:42 +0100 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=91=B7=20Add=20CI=20build=20system=20?= =?UTF-8?q?-=20bye=20bye=20Travis,=20welcome=20to=20actions!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creates a new action and the different files needed to build - python requirements - latex (and ubuntu) packages needed - ruby gems requirements as a Gemfile --- .github/python/requirements.txt | 2 ++ .github/texlive/requirements.txt | 9 +++++++ .github/workflows/build_site.yml | 43 ++++++++++++++++++++++++++++++++ Gemfile | 4 +++ 4 files changed, 58 insertions(+) create mode 100644 .github/python/requirements.txt create mode 100644 .github/texlive/requirements.txt create mode 100644 .github/workflows/build_site.yml create mode 100644 Gemfile diff --git a/.github/python/requirements.txt b/.github/python/requirements.txt new file mode 100644 index 0000000..ce5f1bb --- /dev/null +++ b/.github/python/requirements.txt @@ -0,0 +1,2 @@ +-r ../../requirements.txt +git+https://github.com/jakevdp/JSAnimation.git diff --git a/.github/texlive/requirements.txt b/.github/texlive/requirements.txt new file mode 100644 index 0000000..facb84a --- /dev/null +++ b/.github/texlive/requirements.txt @@ -0,0 +1,9 @@ +pandoc +texlive-latex-base +texlive-latex-extra +texlive-fonts-recommended +texlive-latex-recommended +texlive-generic-recommended +texlive-xetex +latex-xcolor +liblapack-dev diff --git a/.github/workflows/build_site.yml b/.github/workflows/build_site.yml new file mode 100644 index 0000000..c1bc7fe --- /dev/null +++ b/.github/workflows/build_site.yml @@ -0,0 +1,43 @@ +name: Build website +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + Build-website: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 # FIXME: add pip + latex + gems + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }} + restore-keys: | + ${{ runner.os }}-gems- + - name: Install TeXLive + uses: DanySK/setup-texlive-action@0.1.1 + - id: setup-python + name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + uses: py-actions/py-dependency-install@v2 + with: + path: ".github/python/requirements.txt" + - name: Building notes + run: make ready + - name: Builds website + uses: helaili/jekyll-action@v2 + with: + target_branch: 'gh-pages' + build_only: true + - name: Build website and deploy + if: github.ref == 'refs/heads/master' + uses: helaili/jekyll-action@v2 + with: + target_branch: 'gh-pages' + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..b73daec --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'jekyll', '~> 3.1.6' +gem 'redcarpet', '~> 3.5.0' From b73c62d3bb8db32e01ddecdc6fab65feffa230ca Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Mon, 27 Sep 2021 13:56:56 +0100 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=91=B7=20Fix=20latex=20dependencies?= =?UTF-8?q?=20on=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some latex dependencies have changed from ubuntu 14 to ubuntu 20! --- .github/texlive/requirements.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/texlive/requirements.txt b/.github/texlive/requirements.txt index facb84a..211f133 100644 --- a/.github/texlive/requirements.txt +++ b/.github/texlive/requirements.txt @@ -1,9 +1,8 @@ pandoc +texlive-base texlive-latex-base +texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended -texlive-latex-recommended -texlive-generic-recommended texlive-xetex -latex-xcolor liblapack-dev From 6fa51add1adfc4e3e4664660889e61d37d886ae9 Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Mon, 27 Sep 2021 14:28:45 +0100 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=92=9A=20Fix=20python=20dependencies?= =?UTF-8?q?=20for=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pinning nbconvert with a particular version that has the templates jupyter/nbgrader#1373 requires also pin jupyter-client to an earlier version jupyter/jupyter_client#637 --- .github/python/requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/python/requirements.txt b/.github/python/requirements.txt index ce5f1bb..89ac246 100644 --- a/.github/python/requirements.txt +++ b/.github/python/requirements.txt @@ -1,2 +1,6 @@ -r ../../requirements.txt git+https://github.com/jakevdp/JSAnimation.git +nbconvert==5.6.1 +# https://github.com/jupyter/nbgrader/issues/1373#issuecomment-702798246 +jupyter-client==6.1.12 +# https://github.com/jupyter/jupyter_client/issues/637 From 7c829f77d67344e12fbcecc25848d880f88f61ea Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Mon, 27 Sep 2021 19:51:57 +0100 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=92=9A=20exclude=20gems=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_config.yml b/_config.yml index 3c9c54f..351361e 100644 --- a/_config.yml +++ b/_config.yml @@ -22,3 +22,7 @@ baseurl: /doctoral-programming-intro markdown: redcarpet redcarpet: extensions: ["strikethrough","tables"] +exclude: + - vendor/ + - Gemfile + - Gemfile.lock From 07bd2914970baa66ddbd140737ecc5a93365bb41 Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Mon, 27 Sep 2021 17:59:24 +0100 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=92=9A=20remove=20pdf=20creation=20fr?= =?UTF-8?q?om=20the=20building=20process?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a07d85c..f82e6de 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ indigo: indigo-jekyll-master .PHONY: ready -ready: indigo $(HTMLS) notes.pdf notebooks.zip +ready: indigo $(HTMLS) notebooks.zip _site: ready jekyll build From 0181e1cfcc4e2b7aee92868aa9e3ed328ad3eb60 Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Mon, 27 Sep 2021 13:41:46 +0100 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=91=B7=20remove=20CI=20build=20system?= =?UTF-8?q?=20files=20from=20Travis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 29 ----------------------------- travis/deploy.sh | 26 -------------------------- travis/secrets.tar.enc | Bin 5136 -> 0 bytes 3 files changed, 55 deletions(-) delete mode 100644 .travis.yml delete mode 100755 travis/deploy.sh delete mode 100644 travis/secrets.tar.enc diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a8a5c2d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -dist: trusty -language: python -sudo: required -python: -- '3.6' -cache: pip -addons: - apt: - packages: - - pandoc - - texlive-latex-base - - texlive-latex-extra - - texlive-fonts-recommended - - texlive-latex-recommended - - texlive-generic-recommended - - texlive-xetex - - latex-xcolor - - liblapack-dev -install: -- pip install --upgrade pip setuptools wheel -- pip install -r requirements.txt -- pip install git+https://github.com/jakevdp/JSAnimation.git -- gem install jekyll -- gem install redcarpet -script: -- python -c "import matplotlib.pyplot" -- make -after_success: - - ./travis/deploy.sh diff --git a/travis/deploy.sh b/travis/deploy.sh deleted file mode 100755 index 98c14db..0000000 --- a/travis/deploy.sh +++ /dev/null @@ -1,26 +0,0 @@ - -#!/bin/bash -set -e - -if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_BRANCH == 'master' ]]; then - - openssl aes-256-cbc -K $encrypted_4014292b586d_key -iv $encrypted_4014292b586d_iv -in travis/secrets.tar.enc -out secrets.tar -d - tar -xvf secrets.tar - REPO=`git config remote.origin.url` - SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} - eval `ssh-agent -s` - chmod 600 deploy_key - ssh-add deploy_key - - cd _site - git init - git checkout -b gh-pages - git config --global user.email "jamespjh@gmail.com" - git config --global user.name "Pushed by Travis CI" - git add . - git commit -m "Pushed by Travis" - git remote add origin $SSH_REPO - git push -f -u origin gh-pages - -fi - diff --git a/travis/secrets.tar.enc b/travis/secrets.tar.enc deleted file mode 100644 index 4cf9c29706c047dcee973c91b34381feab4ce075..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5136 zcmV+r6z}WYGQ$8KCJ0ZVt?~oQ+Si1iE;v3u9rbvFEEWoy+lWw`&^;tZ081#y4S^afva`a9R{!ib7}maQhBj>CG1)GvpFm!-CQL_3ACa;HnHQk; z#xq`qNA7(qnzmDYz%ViZd=qBg-KGZ~irP!qMO{X6dX06=R7r#j`T^Vnx6OpR>Pi64 z>}W|hFQ?Tip?lX~(Y=<4D2VGjfq$MFuE&p|+ zQoZdO!Ob6~mU>;z2#lnFMr^trI$WAk=Bj2LZ%?1B2%{6F8G<(0IFZI7Ys)cNHQ5Kj zAociH8H+iD_>B1xwQgnS8nGyAFDHp+b*O*251#x+e6uPS!0HC%OJ+I;1VygS`Vah_ zm!$e(@KJl#5lJGtKJMOjW#T}W(iS1{$Q^;0b?kC&DVCTo&mH^(Aw78YBVsKaV%krp zS8;X3bZA=k~v{(4w+w~C#O18<+b;$;D^fKU{cd(EYd35g~Zo#qk`K-mIL z)X4h7FNyjZpxuEghCs&tPNh%JsSEVur?us; z`7eAA+zM*QQ>8(@d8VA}c@ALJ+R2t@pcgUcdMSq^Hk6))IGbA&_zZ{GDR1 zTe8pvUs!aYekN%8J`4*o-A+6LDzU_%f1uI*!~%k@@gNPBJcmLg!s+<$6i6`g3J@?P z$MJ|@w!#138QSXby9)^mi5nHYGSGK5a)cM@v3J8*JJL)4Kx~5hegyC`I$MrN;;CJs zBNlr+k+M26?Op%!utieL|9|rU>~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 deletions(-) diff --git a/.github/workflows/build_site.yml b/.github/workflows/build_site.yml index c1bc7fe..3a0a739 100644 --- a/.github/workflows/build_site.yml +++ b/.github/workflows/build_site.yml @@ -2,10 +2,10 @@ name: Build website on: push: branches: - - master + - main pull_request: branches: - - master + - main jobs: Build-website: runs-on: ubuntu-latest @@ -36,7 +36,7 @@ jobs: target_branch: 'gh-pages' build_only: true - name: Build website and deploy - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/main' uses: helaili/jekyll-action@v2 with: target_branch: 'gh-pages'