From d6980bc3273e1cf1a73feee6bb523d1568405685 Mon Sep 17 00:00:00 2001 From: Vedang Manerikar Date: Thu, 6 Oct 2022 18:15:55 +0530 Subject: Enable testing against MacOS in CI/CD! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is pretty cool, I hope it works! 🤞 It uses the `macos` orb provided by CircleCI, as documented here: https://circleci.com/docs/using-macos This commit also rewrites the older anchor style common steps into the newer command syntax, which is more readable. The command syntax is documented here: https://circleci.com/docs/configuration-reference#commands Installing pre-reqs on MacOS via `brew` was non-trivial. This is mainly because of the `sed` command used in the `Makefile`. It isn't a problem normally because it is only used for packaging, which is done on Melpa Relates to: #98 --- .circleci/config.yml | 110 ++++++++++++++++----- .../test/docker/templates/ubuntu-22.Dockerfile.in | 2 +- 2 files changed, 87 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48cb5b6..636546d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,47 +1,109 @@ version: 2.1 -# Default actions to perform on each Emacs version -default: &default-steps - steps: - - checkout - - run: apt-get update && apt-get install -y gcc make automake autoconf libpng-dev libz-dev libpoppler-glib-dev - - run: cask upgrade-cask || true - - run: emacs --version - - run: cask --version - - run: cask install - - run: make test - -# Enumerated list of Emacs versions +orbs: + macos: circleci/macos@2 + +commands: + install-ubuntu-prereqs: + steps: + - run: + name: Install base prereqs needed for running make commands + command: | + apt-get update --fix-missing -y && apt-get install -y make tzdata + install-pdf-tools-server: + steps: + - checkout + - run: + name: Install pdf-tools Server Pre-reqs and Compile epdfinfo + command: | + make autobuild + - run: + name: Upgrade Cask to the latest version + command: | + cask upgrade-cask || true + - run: + name: Confirm that Emacs is installed and on Path + command: | + emacs --version + - run: + name: Confirm that Cask is installed and on Path + command: | + cask --version + - run: + name: Install pdf-tools elisp pre-reqs + command: | + cask install + - run: + name: Run pdf-tools elisp tests + command: | + make test + +# Test various Emacs versions on Ubuntu jobs: - test-emacs-26: + test-on-emacs-26: docker: - image: silex/emacs:26-ci-cask entrypoint: bash - <<: *default-steps + steps: + - install-ubuntu-prereqs + - install-pdf-tools-server - test-emacs-27: + test-on-emacs-27: docker: - image: silex/emacs:27-ci-cask entrypoint: bash - <<: *default-steps + steps: + - install-ubuntu-prereqs + - install-pdf-tools-server - test-emacs-28: + test-on-emacs-28: docker: - image: silex/emacs:28-ci-cask entrypoint: bash - <<: *default-steps + steps: + - install-ubuntu-prereqs + - install-pdf-tools-server - test-emacs-master: + test-on-emacs-master: docker: - image: silex/emacs:master-ci-cask entrypoint: bash - <<: *default-steps + steps: + - install-ubuntu-prereqs + - install-pdf-tools-server + + test-on-macos: + macos: + xcode: "14.1.0" + resource_class: medium + environment: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + steps: + - run: + name: Install Emacs on MacOS + command: | + brew install --cask emacs + - run: + name: Install Cask on MacOS + command: | + git clone https://github.com/cask/cask ~/.cask + - run: + name: Install Brew prereqs + command: | + brew install gnu-sed + - run: + name: Add Cask and Gnu-SED to the Path + command: | + echo 'export PATH="$HOME"/.cask/bin:"$(brew --prefix)"/opt/gnu-sed/libexec/gnubin:"$PATH"' >> "$BASH_ENV" + - install-pdf-tools-server workflows: version: 2 ci-test-matrix: jobs: - - test-emacs-26 - - test-emacs-27 - - test-emacs-28 - - test-emacs-master + - test-on-emacs-26 + - test-on-emacs-27 + - test-on-emacs-28 + - test-on-emacs-master + - test-on-macos diff --git a/server/test/docker/templates/ubuntu-22.Dockerfile.in b/server/test/docker/templates/ubuntu-22.Dockerfile.in index 217daed..2ac7127 100644 --- a/server/test/docker/templates/ubuntu-22.Dockerfile.in +++ b/server/test/docker/templates/ubuntu-22.Dockerfile.in @@ -2,4 +2,4 @@ FROM ubuntu:jammy ARG DEBIAN_FRONTEND=noninteractive # Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild -RUN apt-get update -y && apt-get install -y make tzdata +RUN apt-get update --fix-missing -y && apt-get install -y make tzdata -- cgit v1.0