Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github: add initial workflow to run tests #38

Merged
merged 18 commits into from
Jun 27, 2024
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: test

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
strategy:
fail-fast: false
matrix:
include:
- os: linux
runs-on: ubuntu-24.04
arch: x86_64

- os: macOS
runs-on: macos-14
arch: aarch64

name: "${{ matrix.os }}-${{ matrix.arch }}"
runs-on: ${{ matrix.runs-on }}

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7

- name: On Linux, switch to GCC 14
if: runner.os == 'Linux'
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
gcc --version

- name: On macOS, allow Meson to find libcrypto and libssl
if: runner.os == 'macOS'
run: |
# For now, symlink rather than altering `meson.build` to pass
# `dirs : ['/opt/homebrew/lib']` to the relevant find_library()` calls.
# This keeps all the CI-related setup in one place, and trivially
# ensures that non-CI library searching is unaffected.
sudo mkdir -p /usr/local/lib
sudo ln -s /opt/homebrew/lib/{libcrypto,libssl}.dylib /usr/local/lib/

- name: Install Meson and Ninja (Linux)
if: runner.os == 'Linux'
run: sudo apt install meson ninja-build

- name: Install Meson and Ninja (macOS)
if: runner.os == 'macOS'
run: brew install meson ninja

- name: Build
run: ./dev build

- name: Run
run: ./dev run