normalise nimble file (#331)
* normalise nimble file * abort redundant builds * bump checkout
This commit is contained in:
parent
6525f4ce1d
commit
189f6e390c
|
@ -6,6 +6,10 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency: # Cancel stale PR builds (but not push builds)
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -46,7 +50,7 @@ jobs:
|
||||||
continue-on-error: ${{ matrix.branch == 'devel' }}
|
continue-on-error: ${{ matrix.branch == 'devel' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install build dependencies (Linux i386)
|
- name: Install build dependencies (Linux i386)
|
||||||
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
|
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
|
||||||
|
@ -68,13 +72,6 @@ jobs:
|
||||||
chmod 755 external/bin/gcc external/bin/g++
|
chmod 755 external/bin/gcc external/bin/g++
|
||||||
echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH
|
echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: 'Install dependencies (macOS)'
|
|
||||||
if: runner.os == 'macOS' && matrix.branch == 'devel'
|
|
||||||
run: |
|
|
||||||
brew install openssl@1.1
|
|
||||||
ln -s $(brew --prefix)/opt/openssl/lib/libcrypto.1.1.dylib /usr/local/lib
|
|
||||||
ln -s $(brew --prefix)/opt/openssl/lib/libssl.1.1.dylib /usr/local/lib/
|
|
||||||
|
|
||||||
- name: MSYS2 (Windows i386)
|
- name: MSYS2 (Windows i386)
|
||||||
if: runner.os == 'Windows' && matrix.target.cpu == 'i386'
|
if: runner.os == 'Windows' && matrix.target.cpu == 'i386'
|
||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
|
@ -117,7 +114,7 @@ jobs:
|
||||||
if: >
|
if: >
|
||||||
runner.os == 'Windows'
|
runner.os == 'Windows'
|
||||||
run: |
|
run: |
|
||||||
echo '${{ github.workspace }}'"/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH
|
echo "${{ github.workspace }}/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Derive environment variables
|
- name: Derive environment variables
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
nimcache
|
nimcache/
|
||||||
*.exe
|
*.exe
|
||||||
nimble.develop
|
nimble.develop
|
||||||
nimble.paths
|
nimble.paths
|
||||||
|
/build/
|
||||||
|
|
|
@ -1,45 +1,47 @@
|
||||||
|
mode = ScriptMode.Verbose
|
||||||
|
|
||||||
packageName = "chronos"
|
packageName = "chronos"
|
||||||
version = "3.0.11"
|
version = "3.0.11"
|
||||||
author = "Status Research & Development GmbH"
|
author = "Status Research & Development GmbH"
|
||||||
description = "Chronos"
|
description = "Networking framework with async/await support"
|
||||||
license = "Apache License 2.0 or MIT"
|
license = "MIT or Apache License 2.0"
|
||||||
skipDirs = @["tests"]
|
skipDirs = @["tests"]
|
||||||
|
|
||||||
### Dependencies
|
requires "nim >= 1.2.0",
|
||||||
|
|
||||||
requires "nim > 1.2.0",
|
|
||||||
"stew",
|
"stew",
|
||||||
"bearssl",
|
"bearssl",
|
||||||
"httputils",
|
"httputils",
|
||||||
"unittest2"
|
"unittest2"
|
||||||
|
|
||||||
var commandStart = "nim c -r --hints:off --verbosity:0 --skipParentCfg:on --warning[ObservableStores]:off --styleCheck:usages --styleCheck:error"
|
let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
|
||||||
|
let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js)
|
||||||
|
let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler
|
||||||
|
let verbose = getEnv("V", "") notin ["", "0"]
|
||||||
|
|
||||||
|
let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error"
|
||||||
|
let cfg =
|
||||||
|
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
|
||||||
|
(if verbose: "" else: " --verbosity:0 --hints:off") &
|
||||||
|
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f"
|
||||||
|
|
||||||
|
proc build(args, path: string) =
|
||||||
|
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
|
||||||
|
|
||||||
|
proc run(args, path: string) =
|
||||||
|
build args & " -r", path
|
||||||
|
|
||||||
task test, "Run all tests":
|
task test, "Run all tests":
|
||||||
var commands = @[
|
for args in [
|
||||||
commandStart & " -d:useSysAssert -d:useGcAssert tests/",
|
"-d:useSysAssert -d:useGcAssert",
|
||||||
commandStart & " -d:chronosStackTrace -d:chronosStrictException tests/",
|
"-d:chronosStackTrace -d:chronosStrictException",
|
||||||
commandStart & " -d:release tests/",
|
"-d:release",
|
||||||
commandStart & " -d:release -d:chronosFutureTracking tests/",
|
"-d:release -d:chronosFutureTracking",
|
||||||
]
|
]: run args, "tests/testall"
|
||||||
when (NimMajor, NimMinor) >= (1, 5):
|
|
||||||
commands.add commandStart & " --gc:orc -d:chronosFutureTracking -d:release -d:chronosStackTrace tests/"
|
|
||||||
|
|
||||||
for testname in ["testall"]:
|
|
||||||
for cmd in commands:
|
|
||||||
let curcmd = cmd & testname
|
|
||||||
echo "\n" & curcmd
|
|
||||||
exec curcmd
|
|
||||||
rmFile "tests/" & testname
|
|
||||||
|
|
||||||
task test_libbacktrace, "test with libbacktrace":
|
task test_libbacktrace, "test with libbacktrace":
|
||||||
var commands = @[
|
var allArgs = @[
|
||||||
commandStart & " -d:release --debugger:native -d:chronosStackTrace -d:nimStackTraceOverride --import:libbacktrace tests/",
|
"-d:release --debugger:native -d:chronosStackTrace -d:nimStackTraceOverride --import:libbacktrace",
|
||||||
]
|
]
|
||||||
|
|
||||||
for testname in ["testall"]:
|
for args in allArgs:
|
||||||
for cmd in commands:
|
run args, "tests/testall"
|
||||||
let curcmd = cmd & testname
|
|
||||||
echo "\n" & curcmd
|
|
||||||
exec curcmd
|
|
||||||
rmFile "tests/" & testname
|
|
||||||
|
|
Loading…
Reference in New Issue