-
Notifications
You must be signed in to change notification settings - Fork 3
149 lines (122 loc) · 3.76 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Build & Test
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
push:
branches:
- main
pull_request:
branches:
- main
jobs:
swift-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-12
- ubuntu-22.04
emacs-version:
- 25.3
- 26.3
- 27.2
- 28.1
- 29.1
configuration:
- release
- debug
# 25.3 doesn't work in CI for some reason and it's incredibly hard to reproduce
exclude:
- os: ubuntu-22.04
emacs-version: 25.3
- os: macos-12
configuration: release
emacs-version: 25.3
env:
EMACS_VERSION: ${{ matrix.emacs-version }}
steps:
- run: echo $LD_LIBRARY_PATH
- run: find /usr/lib -name libstdc++.so.6
- name: Checkout source code
uses: actions/checkout@v2
- name: Setup Swift
if: runner.os == 'Linux'
uses: swift-actions/setup-swift@v1
- name: Setup Emacs
uses: purcell/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}
- uses: actions/cache@v3
id: cache-cask-packages
with:
path: .cask
key: cache-cask-packages-000
- uses: actions/cache@v3
id: cache-cask-executable
with:
path: ~/.cask
key: cache-cask-executable-000
- name: Setup Cask
uses: cask/setup-cask@master
if: steps.cache-cask-executable.outputs.cache-hit != 'true'
with:
version: snapshot
- run: echo "$HOME/.cask/bin" >> $GITHUB_PATH
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
# A nasty workaround for Swift standard libraries on linux that don't set their RPATH to
# libstdc++ properly. Evidently, it becomes problematic with nix installed Emacs.
- name: Create symlink and set LD_LIBRARY_PATH
run: |
mkdir -p /tmp/libstdc++
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /tmp/libstdc++/libstdc++.so.6
- name: Run tests
run: swift test -c ${{ matrix.configuration }}
env:
LD_LIBRARY_PATH: /tmp/libstdc++
xcodebuild-test:
runs-on: macos-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Setup Emacs
uses: purcell/setup-emacs@master
with:
version: 29.1
- uses: actions/cache@v3
id: cache-cask-packages
with:
path: .cask
key: cache-cask-packages-000
- uses: actions/cache@v3
id: cache-cask-executable
with:
path: ~/.cask
key: cache-cask-executable-000
- name: Setup Cask
uses: cask/setup-cask@master
if: steps.cache-cask-executable.outputs.cache-hit != 'true'
with:
version: snapshot
- run: echo "$HOME/.cask/bin" >> $GITHUB_PATH
- name: Run tests via xcodebuild
run: xcodebuild -scheme EmacsSwiftModule-Package test -destination "platform=macOS"
sanitize-test:
runs-on: macos-latest
strategy:
matrix:
sanitizer:
- thread
- address
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Run unit-tests with sanitizers
run: swift test -c debug --sanitize=${{ matrix.sanitizer }}