ci: copy-paste updates from other projects

This commit is contained in:
Jacek Sieka 2024-10-30 10:56:30 +01:00
parent b88ed93a44
commit 027953b3f3
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8
3 changed files with 39 additions and 9 deletions

View File

@ -1,5 +1,14 @@
name: CI
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
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:
build:
@ -7,7 +16,6 @@ jobs:
fail-fast: false
max-parallel: 20
matrix:
test_lang: [c]
target:
- os: linux
cpu: amd64
@ -19,6 +27,7 @@ jobs:
cpu: amd64
- os: windows
cpu: i386
branch: [version-1-6, version-2-0, version-2-2, devel]
include:
- target:
os: linux
@ -30,14 +39,13 @@ jobs:
os: windows
builder: windows-latest
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ matrix.test_lang }}'
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
steps:
- name: Checkout nim-bncurve
- name: Checkout
uses: actions/checkout@v4
with:
path: nim-bncurve
submodules: false
submodules: true
- name: Install build dependencies (Linux i386)
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
@ -146,9 +154,12 @@ jobs:
env MAKE="$MAKE_CMD -j2" ARCH_OVERRIDE=$PLATFORM CC=gcc bash build_nim.sh nim csources dist/nimble NimBinaries
echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
- name: Run nim-bncurve tests
- name: Run tests
shell: bash
working-directory: nim-bncurve
run: |
nim --version
nimble --version
gcc --version
nimble install -y --depsOnly
env TEST_LANG="${{ matrix.test_lang }}" nimble test
nimble test

1
.gitignore vendored
View File

@ -1 +1,2 @@
/tests
build/

View File

@ -11,6 +11,24 @@ requires "nim >= 1.6.0",
"nimcrypto",
"stint"
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 cfg =
" --styleCheck:usages --styleCheck:error" &
(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 & " --mm:refc -r", path
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:orc -r", path
task test, "Run all tests":
for tprog in @[
"tests/tarith",
@ -20,4 +38,4 @@ task test, "Run all tests":
"tests/tether",
"tests/tvectors",
]:
exec "nim c -f -r -d:release --styleCheck:error --styleCheck:usages --threads:on " & tprog
run "--threads:on", tprog