Skip to content

Commit c699552

Browse files
committed
ci: adapt to new macos arm-based runners
The new macos runner is arm-based and missing some software is missing that all other runners have: - ImageMagick - Edge and msedgedriver - Firefox and geckodriver Take a shot at optionally installing the above when we need them. There is also no JDK8 for arm-based macos. We weren't testing that particular scenario on the intel-based macos runners but I updated the code to reflect this fact.
1 parent 2826a19 commit c699552

File tree

3 files changed

+53
-12
lines changed

3 files changed

+53
-12
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Test
33
on:
44
push:
55
branches:
6-
- main
6+
- master
77
pull_request:
88
branches:
9-
- main
9+
- master
1010

1111
jobs:
1212
setup:
@@ -77,6 +77,30 @@ jobs:
7777
if: ${{ matrix.os == 'ubuntu' }}
7878
run: sudo apt-get -y install fluxbox
7979

80+
# No longer pre-installed on macOS github action runners
81+
- name: Install Image Magick on macOS
82+
if: ${{ matrix.os == 'macos' && contains(matrix.needs, 'imagemagick') }}
83+
run: brew install imagemagick
84+
85+
# No longer pre-installed on macOS github action runners
86+
- name: Install Microsoft Edge on macOS
87+
if: ${{ matrix.os == 'macos' && contains(matrix.needs, 'edge') }}
88+
run: |
89+
brew install --cask microsoft-edge
90+
EDGE_VERSION=$(defaults read /Applications/Microsoft\ Edge.app/Contents/Info CFBundleShortVersionString)
91+
DRIVER_URL="https://msedgedriver.azureedge.net/${EDGE_VERSION}/edgedriver_mac64_m1.zip"
92+
curl -o msedgedriver.zip $DRIVER_URL
93+
mkdir $RUNNER_TEMP/edgedriver
94+
unzip msedgedriver.zip -d $RUNNER_TEMP/edgedriver
95+
echo "$RUNNER_TEMP/edgedriver" >> $GITHUB_PATH
96+
97+
# No longer pre-installed on macOS github action runners
98+
- name: Install Firefox on macOS
99+
if: ${{ matrix.os == 'macos' && contains(matrix.needs, 'firefox') }}
100+
run: |
101+
brew install --cask firefox
102+
brew install geckodriver
103+
80104
- uses: actions/checkout@v4
81105

82106
- name: Clojure deps cache

doc/01-user-guide.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Etaoin's test suite covers the following OSes and browsers for both Clojure and
5454
| -
5555
| -
5656

57-
| macOS
57+
| macOS ^1^
5858
| yes
5959
| yes
6060
| yes
@@ -68,7 +68,8 @@ Etaoin's test suite covers the following OSes and browsers for both Clojure and
6868

6969
|===
7070

71-
NOTE: We did once test against PhantomJS, but since work has long ago stopped on this project, we have dropped testing
71+
1. Our GitHub Actions macOS tests run on silicon (aka arm64, aarch64 or M*) hardware
72+
2. We did once test against PhantomJS, but since work has long ago stopped on this project, we have dropped testing
7273

7374
== Installation
7475

@@ -2097,7 +2098,7 @@ a| Random port when lanching local WebDriver process, else varies by vendor:
20972098
a| `:webdriver-url` for *WebDriver* process. When:
20982099

20992100
* omitted, creates a new local WebDriver process (unless `:host` was specified).
2100-
* specified, attempts to connect to an existing running WebDriver process.
2101+
* specified, attempts to connect to an existing running WebDriver process.
21012102

21022103
See <<connecting-existing>>.
21032104

script/test_matrix.clj

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
(when (= "ubuntu" os) "--launch-virtual-display")]
1616
(remove nil?)
1717
(string/join " "))
18+
:needs (case id
19+
"unit"
20+
["chrome" "firefox"]
21+
22+
"api"
23+
(conj ["imagemagick"] browser)
24+
25+
"ide"
26+
[browser])
1827
:desc (->> [id os browser (if (= "jvm" platform)
1928
(str "jdk" jdk-version)
2029
platform)]
@@ -27,14 +36,18 @@
2736
:cmd (if (= "ubuntu" os)
2837
"bb test-doc --launch-virtual-display"
2938
"bb test-doc")
39+
:needs ["chrome" "firefox"]
3040
:desc (str "test-doc " os " jdk" jdk-version)} )
3141

3242
(defn- github-actions-matrix []
33-
(let [oses ["macos" "ubuntu" "windows"]
43+
(let [os-jdks {"ubuntu" ["8" "11" "17" "21"]
44+
;; macOS on GitHub Actions is now arm-based and does not include jdk8
45+
"macos" ["11" "17" "21"]
46+
"windows" ["8" "11" "17" "21"]}
47+
oses (keys os-jdks)
3448
ide-browsers ["chrome" "firefox"]
3549
api-browsers ["chrome" "firefox" "edge" "safari"]
3650
platforms ["jvm" "bb"]
37-
jdk-versions ["8" "11" "17" "21"]
3851
default-opts {:jdk-version "21"}]
3952
(->> (concat
4053
(for [os oses
@@ -43,7 +56,8 @@
4356
(for [os oses
4457
platform platforms
4558
browser ide-browsers]
46-
(test-def (merge default-opts {:os os :id "ide" :platform platform :browser browser})))
59+
(test-def (merge default-opts
60+
{:os os :id "ide" :platform platform :browser browser})))
4761
(for [os oses
4862
platform platforms
4963
browser api-browsers
@@ -52,12 +66,14 @@
5266
(test-def (merge default-opts {:os os :id "api" :platform platform :browser browser})))
5367
;; for jdk coverage we don't need to run across all oses and browsers
5468
(for [id ["unit" "ide" "api"]
55-
jdk-version jdk-versions
69+
jdk-version (get os-jdks "ubuntu")
5670
:when (not= jdk-version (:jdk-version default-opts))]
57-
(test-def {:jdk-version jdk-version :os "ubuntu" :id id :platform "jvm" :browser "firefox"}))
71+
(test-def {:jdk-version jdk-version :os "ubuntu" :id id
72+
:platform "jvm"
73+
:browser (when (not= "unit" id) "firefox")}))
5874
(for [os oses]
5975
(test-doc (merge default-opts {:os os})))
60-
(for [jdk-version jdk-versions
76+
(for [jdk-version (get os-jdks "ubuntu")
6177
:when (not= jdk-version (:jdk-version default-opts))]
6278
(test-doc {:jdk-version jdk-version :os "ubuntu"})))
6379
(sort-by (juxt #(parse-long (:jdk-version %)) :desc))
@@ -91,7 +107,7 @@
91107
(status/line :detail
92108
(if (= "json" (:format opts))
93109
(json/generate-string matrix)
94-
(doric/table [:os :jdk-version :cmd :desc] matrix)))))))
110+
(doric/table [:os :jdk-version :cmd :needs :desc] matrix)))))))
95111

96112
(main/when-invoked-as-script
97113
(apply -main *command-line-args*))

0 commit comments

Comments
 (0)