[pre-commit.ci] pre-commit autoupdate #221
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |