From 7a33ee3fd6bfca700cf075dbb8576cd406c2a908 Mon Sep 17 00:00:00 2001 From: Alex Povel Date: Wed, 11 May 2022 19:43:00 +0200 Subject: [PATCH] Switch from GitLab to GitHub This includes updating URLs, removing GitLab configuration files and updating docs --- .devcontainer/image/Dockerfile | 2 +- .gitattributes | 11 +- .gitlab-ci.yml | 122 --------------------- .gitlab/issue_templates/Bug.md | 27 ----- .gitlab/issue_templates/Feature-Request.md | 10 -- CHANGELOG.md | 2 - Makefile | 7 +- chapters/frontmatter/preface.tex | 2 +- chapters/mainmatter/usage.tex | 9 +- pandoc/metadata.yaml | 4 +- tests/README.md | 2 +- 11 files changed, 15 insertions(+), 183 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 .gitlab/issue_templates/Bug.md delete mode 100644 .gitlab/issue_templates/Feature-Request.md diff --git a/.devcontainer/image/Dockerfile b/.devcontainer/image/Dockerfile index f5eb640..5b58fd0 100644 --- a/.devcontainer/image/Dockerfile +++ b/.devcontainer/image/Dockerfile @@ -197,7 +197,7 @@ RUN useradd --create-home ${USER} LABEL \ maintainer="Alex Povel " \ org.label-schema.description="TeXLive with most packages, JavaRE, Inkscape, pandoc and more" \ - org.label-schema.vcs-url="https://collaborating.tuhh.de/alex/latex-cookbook" \ + org.label-schema.vcs-url="https://github.com/alexpovel/latex-cookbook" \ org.label-schema.schema-version="1.0" ARG INSTALL_DIR="/install" diff --git a/.gitattributes b/.gitattributes index 7def9ca..f81b3a8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,19 +1,10 @@ -# This file tells platforms like GitLab how to treat certain files, e.g. -# for syntax highlighting. - -# GitLab uses the Rouge Ruby gem; for available languages, see: -# https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers - # bib -> latex does not help much, since it is also not valid latex, but at # least highlights comments (%) correctly *.bib linguist-language=latex -*.bib gitlab-language=latex # Bash is wrong, it is really a plain-text file. -# However, it gets us comment highlighting (hiding/grey) -# and is close enough. +# However, it gets us comment highlighting (hiding/grey) and is close enough. *.profile linguist-language=bash -*.profile gitlab-language=bash # Do not include git config files in archives (e.g. when downloading as ZIP): .git* export-ignore diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ec56bfe..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,122 +0,0 @@ -# This file configures the GitLab Continuous Integration system, -# and as such has little to do with core git, the version control system. -# See also here: https://docs.gitlab.com/ee/ci/quick_start/#create-a-gitlab-ciyml-file -# It relies heavily on the Makefile, also part of this repository. - -# ====================================================================================== -# ====================================================================================== -# Global defaults, overwritable in each job -# ====================================================================================== -# ====================================================================================== - -default: - image: - # Image from dockerhub per default. Specify full path to use a different image. - name: alexpovel/latex - # Override any entrypoint back to a naked shell so that job `script`s can be - # executed normally. - # See also: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#overriding-the-entrypoint-of-an-image - # Cannot use `make` as ENTRYPOINT even if all scripts used it: runner expects an - # entrypoint that accepts shell scripts ("the runner expects that the image has - # no entrypoint or that the entrypoint is prepared to start a shell command. ") - # See also: - # https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#overriding-the-entrypoint-of-an-image - entrypoint: [""] - # In general, pipelines currently run into a lot of issues pulling images, see for - # example: - # https://collaborating.tuhh.de/alex/latex-cookbook/-/jobs/553678 - # with its "ERROR: Job failed: failed to pull image". - # There is nothing that can currently be done except for retrying (see - # Ticket#2022010509000459 from servicedesk). - # Having to retry has been an issue in the past too, see also - # https://collaborating.tuhh.de/alex/latex-cookbook/-/commit/f9dc86b1b40ec9626d9bcfc027e8e466b5348ba0 - retry: 2 - -# ====================================================================================== -# ====================================================================================== -# Job templates (start with period). -# Not actually run by the runner, but can be used to extend other jobs, keeping the -# config dry. -# The main logic happens here, the actual jobs only combine these as needed. -# ====================================================================================== -# ====================================================================================== - -.make: # Core job template - # Use make as the basis for all jobs. This allows to also easily run the steps - # offline/locally, as well as transition to other CI engines. All job names have to - # correspond to targets make knows about (see Makefile). - # Note we cannot have `default: script:`, so this approach works better. - script: make ${CI_JOB_NAME} - -.pdf: # Job template for PDF-producing jobs - extends: .make - stage: build - before_script: - # Make sure to clean any PDFs that might have crept in via the cache, forcing a - # remake at least once (otherwise, no remake might occur). - # It would be better to exclude the PDFs from the cache in the first place. This is - # not available yet, see: https://gitlab.com/gitlab-org/gitlab/-/issues/220017#note_440142507 - - make clean-pdf - # LaTeX and pandoc stages both provide PDFs: - artifacts: - # artifacts.zip is renamed to current tag/branch: - name: "$CI_COMMIT_REF_NAME" - paths: - # Return all found *.pdf-files using wildcard. - # For example, a thesis and the accompanying presentation. - - "*.pdf" - -.test: - extends: .make - stage: test - # Would be ideal to read the image tag from `pyproject.toml`, i.e. the poetry project - # file. See also: https://gitlab.com/gitlab-org/gitlab/-/issues/34202#note_444271649. - image: python:3.10 - variables: - PIP_DOWNLOAD_DIR: ".pip" - before_script: - - cd tests - # Allow caching by only downloading first: - - pip download --dest=${PIP_DOWNLOAD_DIR} poetry - - pip install --find-links=${PIP_DOWNLOAD_DIR} poetry - # Make available for caching by installing to current directory: - - poetry config virtualenvs.in-project true - - poetry install -vv - cache: - untracked: true - key: - files: - # Cache is invalidated if any of these files changes, but also shared if - # these two files are equal. - - poetry.lock - - pyproject.toml - -# ====================================================================================== -# ====================================================================================== -# Actual job definitions. -# All job names have to correspond to make targets, see .make above. -# ====================================================================================== -# ====================================================================================== - -preflight: - extends: .make - stage: .pre - # Preflight checks are relevant, but we are interested in how exactly later jobs - # error out if preflight fails. Therefore, allow failure. - allow_failure: true - -tex: - extends: .pdf - cache: - untracked: true - key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" - -README.pdf: - extends: .pdf - -test-self: - extends: .test - needs: [] # Allows job to start immediately - -test-pdfs: - extends: .test diff --git a/.gitlab/issue_templates/Bug.md b/.gitlab/issue_templates/Bug.md deleted file mode 100644 index b21e34d..0000000 --- a/.gitlab/issue_templates/Bug.md +++ /dev/null @@ -1,27 +0,0 @@ -## Summary - - - -## Steps to reproduce - - - -## What is the current *bug* behavior? - - - -## What is the expected *correct* behavior? - - - -## Relevant logs and/or screenshots - - - -## Possible fixes - - - -/label ~"bug" -/assign @alex diff --git a/.gitlab/issue_templates/Feature-Request.md b/.gitlab/issue_templates/Feature-Request.md deleted file mode 100644 index 2808652..0000000 --- a/.gitlab/issue_templates/Feature-Request.md +++ /dev/null @@ -1,10 +0,0 @@ -## Problem to solve - - - -## Proposal - - - -/label ~"feature" -/assign @alex diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fe188f..72fed27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -[[_TOC_]] - ## [Unreleased] ## [4.0.0] - 2021-10-18 diff --git a/Makefile b/Makefile index ae51588..b0e7fbd 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ # `make file.pdf` *both locally and in CI*. # Without make, we would otherwise have very different build steps in local and CI # environments. -# Additionally, using `make`, the CI instructions (.gitlab-ci.yml) can be simplified -# considerably, leading to decoupling. +# Additionally, using `make`, the CI instructions (.gitlab-ci.yml, GitHub actions etc.) +# can be simplified considerably, leading to decoupling. # Moving CI systems then becomes much easier. @@ -65,6 +65,9 @@ PANDOC_FLAGS = --defaults=pandoc/defaults.yaml # See also: # https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html#Conditional-Syntax # https://docs.gitlab.com/ee/ci/variables/predefined_variables.html +# +# That same environment variable is defined for GitHub Actions as well: +# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables ifdef CI # In container, run commands directly: LATEXMK = latexmk diff --git a/chapters/frontmatter/preface.tex b/chapters/frontmatter/preface.tex index a072e4d..705aced 100644 --- a/chapters/frontmatter/preface.tex +++ b/chapters/frontmatter/preface.tex @@ -63,6 +63,6 @@ \paragraph{Source Repository} The source repository for this document is at \begin{center} - \url{https://collaborating.tuhh.de/alex/latex-cookbook} . + \url{https://github.com/alexpovel/latex-cookbook} . \end{center} Any references to the \enquote{source} or \enquote{repository} refer to that project. diff --git a/chapters/mainmatter/usage.tex b/chapters/mainmatter/usage.tex index c7895e9..8d430a3 100644 --- a/chapters/mainmatter/usage.tex +++ b/chapters/mainmatter/usage.tex @@ -166,11 +166,10 @@ \subsection{Compilation steps} \end{displayquote} Good riddance to that. -If all of this is embedded into a pipeline on GitLab, your documents are built whenever -you \texttt{git push} to the remote server (or whenever you configure it to). -It does not get simpler; the downside is of course the lengthier setup, but all of that -is explained in the -\href{https://collaborating.tuhh.de/alex/latex-cookbook/-/blob/master/README.md}{README}. +If all of this is embedded into a pipeline on GitLab, GitHub Actions, or similar, +your documents are built whenever you \texttt{git push} to the remote server +(or whenever you configure it to). +It does not get simpler; the downside is of course the lengthier setup. Also, the repository itself is a live demonstration where everything is set up already! \subsubsection{Slow compilation} diff --git a/pandoc/metadata.yaml b/pandoc/metadata.yaml index 2e384ae..e6311ef 100644 --- a/pandoc/metadata.yaml +++ b/pandoc/metadata.yaml @@ -1,3 +1,3 @@ author: [Alex Povel] -subject: "Advantages of a workflow using LaTeX with GitLab" -keywords: [LaTeX, GitLab, CI, CD, Markdown] +subject: "Advantages of a workflow using LaTeX with GitLab, GitHub Actions etc." +keywords: [LaTeX, CI, CD, Markdown] diff --git a/tests/README.md b/tests/README.md index c548f13..1afd7b1 100644 --- a/tests/README.md +++ b/tests/README.md @@ -53,7 +53,7 @@ If it does, `poetry` will complain to you accordingly. In such a case, [`pyenv`](https://github.com/pyenv/pyenv) has worked well for me to set up a suitable, local or system-wide Python interpreter of *any* desired version. -The [setup for the CI pipeline](../.gitlab-ci.yml) is quite different. +The setup for the CI pipeline (GitHub Actions) is quite different. Take a look if you like, but the steps there are not applicable to local usage. ## Running