Skip to content

Commit

Permalink
ci: add tests workflow (#52)
Browse files Browse the repository at this point in the history
Run `nimble test` on pushing to the `dev` or `main` branch, on
pull request, and on workflow dispatch.

Let's just add Linux x86_64 for now, because:

- macOS x86_64 fails due to missing libffi.a
- macOS arm64 fails due to missing binary build for Nim 2.0.0

Closes: #49
  • Loading branch information
ee7 authored Feb 19, 2024
1 parent 1de4a8d commit 3f5d421
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: tests

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

permissions:
contents: read

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

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

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Nim
uses: iffy/install-nim@049e1fad22d41813c77cff11ab8e1541a872014a
with:
version: "binary:2.0.0"
env:
GITHUB_TOKEN: ${{ github.token }} # Avoid rate limiting.

- name: Install Nimble dependencies
run: nimble --accept install --depsOnly

- name: Build
run: nimble build # Trigger `before build` task to install headers.

- name: Run tests
run: nimble test

0 comments on commit 3f5d421

Please sign in to comment.