Skip to content

Commit

Permalink
sys(treewide): nimskull support and stable nim tests
Browse files Browse the repository at this point in the history
* Expanded test matrix to include nimskull and stable nim versions
* Bumped minimum Nim to stable
* Set version to 0.1.0
* Dropped direct dependency on balls
  • Loading branch information
alaviss committed Jan 31, 2024
1 parent 26c36ca commit cfd7192
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 17 deletions.
54 changes: 50 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ jobs:
fail-fast: false
matrix:
branch: [devel]
compiler:
- name: nim
version: devel
- name: nim
version: version-2-0
- name: nim
version: version-1-6
- name: nimskull
version: "*"
target: [linux, macos, windows]
arch: [i386, amd64]
include:
Expand All @@ -29,7 +38,9 @@ jobs:
exclude:
- target: macos
arch: i386
name: ${{ matrix.target }} on ${{ matrix.arch }} (Nim ${{ matrix.branch }})
name:
${{ matrix.target }} on ${{ matrix.arch }} (${{ matrix.compiler.name }}
${{ matrix.compiler.version }})
runs-on: ${{ matrix.builder }}

defaults:
Expand All @@ -56,30 +67,65 @@ jobs:
libstdc++-10-dev-i386-cross
mkdir -p ~/.config/nim
cat << EOF > ~/.config/nim/nim.cfg
cpu = "i386"
gcc.exe = "i686-linux-gnu-gcc-10"
gcc.cpp.exe = "i686-linux-gnu-g++-10"
gcc.linkerexe = "i686-linux-gnu-gcc-10"
gcc.cpp.linkerexe = "i686-linux-gnu-g++-10"
EOF
- name: Configure target architecture for Windows (i386)
if: matrix.arch == 'i386' && runner.os == 'Windows'
run: |
mkdir -p "$APPDATA/nim"
echo 'cpu = "i386"' >> "$APPDATA/nim/nim.cfg"
- name: Setup GCC (Windows-only)
if: runner.os == 'Windows'
uses: bwoodsend/setup-winlibs-action@v1.14
with:
architecture: ${{ matrix.winlib_arch }}

- name: Setup Nim
if: matrix.compiler.name == 'nim'
uses: alaviss/setup-nim@0.1.1
with:
path: nim
version: ${{ matrix.branch }}
version: ${{ matrix.compiler.version }}
architecture: ${{ matrix.arch }}

- name: Setup nimskull
id: nimskull
if: matrix.compiler.name == 'nimskull'
uses: nim-works/setup-nimskull@0.1.0
with:
nimskull-version: ${{ matrix.compiler.version }}

- name: Fetch nimble source for nimskull
if: matrix.compiler.name == 'nimskull'
uses: actions/checkout@v4.1.1
with:
path: nimble
repository: alaviss/nimble
ref: nimskull

- name: Install nimble for nimskull
if: matrix.compiler.name == 'nimskull'
run: |
nim c -d:release -o:"$NIMSKULL_BIN/nimble" src/nimble.nim
# Add nimble binary folder to PATH
echo "$HOME/.nimble/bin" >> "$GITHUB_PATH"
working-directory: nimble
env:
NIMSKULL_BIN: ${{ steps.nimskull.outputs.bin-path }}

- name: Install dependencies
run: nimble install -y --depsOnly
run: |
nimble install -y --depsOnly
nimble install -y "https://github.com/disruptek/balls@>= 3.9.11 & < 4.0.0"
- name: Run tests
run: nimble test
run: balls

- name: Build docs
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# An abstraction layer for common operating system services

[![CI status](https://github.com/alaviss/nim-sys/workflows/CI/badge.svg)](https://github.com/alaviss/nim-sys/actions?query=workflow%3ACI)
![Minimum supported Nim version](https://img.shields.io/badge/nim-1.5.1%2B-informational?style=flat&logo=nim)
![Minimum supported Nim version](https://img.shields.io/badge/nim-1.6.0%2B-informational?style=flat&logo=nim)
[![License](https://img.shields.io/github/license/alaviss/nim-sys?style=flat)](#license)

This package is an experiment in rewriting various parts of stdlib's `os` module.
Expand Down
15 changes: 4 additions & 11 deletions sys.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.1.0"
version = "0.0.1"
author = "Leorize"
description = "Abstractions for common operating system services"
license = "MIT"
Expand All @@ -9,19 +9,12 @@ srcDir = "src"

# Dependencies

requires "nim >= 1.5.1"
requires "https://github.com/disruptek/balls >= 3.9.0 & < 4.0.0"
when (NimMajor, NimMinor, NimPatch) < (1, 9, 0):
requires "nim >= 1.6.0"
when not defined(isNimSkull) and (NimMajor, NimMinor, NimPatch) < (1, 9, 0):
requires "https://github.com/nim-works/cps >= 0.8.0 & < 0.9.0"
else:
requires "https://github.com/nim-works/cps >= 0.9.0 & < 0.10.0"
requires "https://github.com/nim-works/cps ^= 0.10.0"
requires "https://github.com/status-im/nim-stew#3c91b8694e15137a81ec7db37c6c58194ec94a6a"

# Bundled as submodule instead since the package can only be installed on Windows.
# requires "https://github.com/khchen/winim#bffaf742b4603d1f675b4558d250d5bfeb8b6630"

task test, "Run test suite":
when defined(windows):
exec "balls.cmd"
else:
exec "balls"
1 change: 0 additions & 1 deletion tests/config.nims

This file was deleted.

1 change: 1 addition & 0 deletions tests/nim.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
path = "$config/../src"

0 comments on commit cfd7192

Please sign in to comment.