Skip to content

Make Swift-only unit-tests and move all tests into swift test #168

Make Swift-only unit-tests and move all tests into swift test

Make Swift-only unit-tests and move all tests into swift test #168

Workflow file for this run

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:
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
exclude:
- os: ubuntu-22.04
emacs-version: 25.3
env:
EMACS_VERSION: ${{ matrix.emacs-version }}
BUILD_DIR: .build/${{ matrix.configuration }}
TEST_LIB: libTestModule.${{ matrix.emacs-version == 28.1 && matrix.os == 'macos-12' && 'dylib' || 'so' }}
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++