Skip to content

Commit d6980bc

Browse files
committed
Enable testing against MacOS in CI/CD!
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
1 parent 5350677 commit d6980bc

File tree

2 files changed

+87
-25
lines changed

2 files changed

+87
-25
lines changed

.circleci/config.yml

Lines changed: 86 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,109 @@
11
version: 2.1
22

3-
# Default actions to perform on each Emacs version
4-
default: &default-steps
5-
steps:
6-
- checkout
7-
- run: apt-get update && apt-get install -y gcc make automake autoconf libpng-dev libz-dev libpoppler-glib-dev
8-
- run: cask upgrade-cask || true
9-
- run: emacs --version
10-
- run: cask --version
11-
- run: cask install
12-
- run: make test
13-
14-
# Enumerated list of Emacs versions
3+
orbs:
4+
macos: circleci/macos@2
5+
6+
commands:
7+
install-ubuntu-prereqs:
8+
steps:
9+
- run:
10+
name: Install base prereqs needed for running make commands
11+
command: |
12+
apt-get update --fix-missing -y && apt-get install -y make tzdata
13+
install-pdf-tools-server:
14+
steps:
15+
- checkout
16+
- run:
17+
name: Install pdf-tools Server Pre-reqs and Compile epdfinfo
18+
command: |
19+
make autobuild
20+
- run:
21+
name: Upgrade Cask to the latest version
22+
command: |
23+
cask upgrade-cask || true
24+
- run:
25+
name: Confirm that Emacs is installed and on Path
26+
command: |
27+
emacs --version
28+
- run:
29+
name: Confirm that Cask is installed and on Path
30+
command: |
31+
cask --version
32+
- run:
33+
name: Install pdf-tools elisp pre-reqs
34+
command: |
35+
cask install
36+
- run:
37+
name: Run pdf-tools elisp tests
38+
command: |
39+
make test
40+
41+
# Test various Emacs versions on Ubuntu
1542
jobs:
16-
test-emacs-26:
43+
test-on-emacs-26:
1744
docker:
1845
- image: silex/emacs:26-ci-cask
1946
entrypoint: bash
20-
<<: *default-steps
47+
steps:
48+
- install-ubuntu-prereqs
49+
- install-pdf-tools-server
2150

22-
test-emacs-27:
51+
test-on-emacs-27:
2352
docker:
2453
- image: silex/emacs:27-ci-cask
2554
entrypoint: bash
26-
<<: *default-steps
55+
steps:
56+
- install-ubuntu-prereqs
57+
- install-pdf-tools-server
2758

28-
test-emacs-28:
59+
test-on-emacs-28:
2960
docker:
3061
- image: silex/emacs:28-ci-cask
3162
entrypoint: bash
32-
<<: *default-steps
63+
steps:
64+
- install-ubuntu-prereqs
65+
- install-pdf-tools-server
3366

34-
test-emacs-master:
67+
test-on-emacs-master:
3568
docker:
3669
- image: silex/emacs:master-ci-cask
3770
entrypoint: bash
38-
<<: *default-steps
71+
steps:
72+
- install-ubuntu-prereqs
73+
- install-pdf-tools-server
74+
75+
test-on-macos:
76+
macos:
77+
xcode: "14.1.0"
78+
resource_class: medium
79+
environment:
80+
HOMEBREW_NO_AUTO_UPDATE: 1
81+
HOMEBREW_NO_INSTALL_CLEANUP: 1
82+
steps:
83+
- run:
84+
name: Install Emacs on MacOS
85+
command: |
86+
brew install --cask emacs
87+
- run:
88+
name: Install Cask on MacOS
89+
command: |
90+
git clone https://github.com/cask/cask ~/.cask
91+
- run:
92+
name: Install Brew prereqs
93+
command: |
94+
brew install gnu-sed
95+
- run:
96+
name: Add Cask and Gnu-SED to the Path
97+
command: |
98+
echo 'export PATH="$HOME"/.cask/bin:"$(brew --prefix)"/opt/gnu-sed/libexec/gnubin:"$PATH"' >> "$BASH_ENV"
99+
- install-pdf-tools-server
39100

40101
workflows:
41102
version: 2
42103
ci-test-matrix:
43104
jobs:
44-
- test-emacs-26
45-
- test-emacs-27
46-
- test-emacs-28
47-
- test-emacs-master
105+
- test-on-emacs-26
106+
- test-on-emacs-27
107+
- test-on-emacs-28
108+
- test-on-emacs-master
109+
- test-on-macos

server/test/docker/templates/ubuntu-22.Dockerfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
FROM ubuntu:jammy
33
ARG DEBIAN_FRONTEND=noninteractive
44
# Need to install make, tzdata here to avoid stupid prompts when running package install via autobuild
5-
RUN apt-get update -y && apt-get install -y make tzdata
5+
RUN apt-get update --fix-missing -y && apt-get install -y make tzdata

0 commit comments

Comments
 (0)