-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
188 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[*] | ||
indent_style = space | ||
insert_final_newline = true | ||
indent_size = 2 | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
name: CI | ||
on: | ||
schedule: | ||
- cron: '30 5 * * *' | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
changes: | ||
# Disable the filter on scheduled runs because we don't want to skip those | ||
if: github.event_name != 'schedule' | ||
continue-on-error: true # Makes sure errors won't stop us | ||
runs-on: ubuntu-latest | ||
outputs: | ||
src: ${{ steps.filter.outputs.src }} | ||
steps: | ||
# For PRs the path filter check with Github API, so no need to checkout | ||
# for them. | ||
- if: github.event_name != 'pull_request' | ||
name: Checkout (if not PR) | ||
uses: actions/checkout@v4 | ||
|
||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
src: | ||
- '**.cfg' | ||
- '**.nims' | ||
- '**.nim' | ||
- '**.nimble' | ||
- 'tests/**' | ||
- '.github/workflows/ci.yml' | ||
build: | ||
# Build if the files we care about are changed. | ||
needs: changes | ||
# Make sure to always run regardless of whether the filter success or not. | ||
# When the filter fails there won't be an output, so checking for `false` | ||
# state is better than checking for `true`. | ||
# | ||
# The always() function here is required for the job to always run despite | ||
# what Github docs said, see: https://github.com/actions/runner/issues/491 | ||
if: always() && !cancelled() && needs.changes.outputs.src != 'false' | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
compiler: | ||
#- name: nim | ||
# version: devel | ||
- name: nimskull | ||
version: "*" | ||
|
||
name: '${{ matrix.os }} (${{ matrix.compiler.name }} ${{ matrix.compiler.version }})' | ||
runs-on: ${{ matrix.os }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: project | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
path: project | ||
|
||
- name: Nim | ||
if: matrix.compiler.name == 'nim' | ||
uses: alaviss/setup-nim@0.1.1 | ||
with: | ||
path: nim | ||
version: ${{ matrix.compiler.version }} | ||
|
||
- name: 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 | ||
if: matrix.compiler.name == 'nimskull' | ||
uses: actions/checkout@v4.1.1 | ||
with: | ||
path: nimble | ||
repository: alaviss/nimble | ||
ref: nimskull | ||
|
||
- name: Build Nimble | ||
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: Valgrind | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt install --fix-missing valgrind | ||
|
||
- name: Dependencies | ||
run: | | ||
nimble --accept install "https://github.com/disruptek/balls" | ||
nimble --accept develop | ||
env: | ||
NIM: ${{ matrix.compiler.name }} | ||
|
||
- name: Examples | ||
run: | | ||
cd examples | ||
balls '***' --path=".." \ | ||
--backend:c --panics:on \ | ||
--mm:arc --define:useMalloc \ | ||
--define:debug --define:release --define:danger | ||
env: | ||
NIM: ${{ matrix.compiler.name }} | ||
|
||
- name: Tests | ||
run: | | ||
balls --path="." \ | ||
--backend:c --panics:on \ | ||
--gc:arc --define:useMalloc \ | ||
--define:debug --define:release --define:danger | ||
- name: Build docs | ||
if: matrix.os == 'ubuntu-latest' && matrix.compiler.name == 'nimskull' | ||
run: | | ||
branch=${{ github.ref }} | ||
branch=${branch##*/} | ||
nimble doc --gc:arc --threads:on --project --outdir:docs --path="." \ | ||
'--git.url:https://github.com/${{ github.repository }}' \ | ||
'--git.commit:${{ github.sha }}' \ | ||
"--git.devel:$branch" \ | ||
insideout.nim | ||
# Ignore failures for older Nim | ||
cp docs/{the,}index.html || true | ||
- name: Publish docs | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && | ||
matrix.os == 'ubuntu-latest' && matrix.compiler.name == 'nimskull' | ||
uses: crazy-max/ghaction-github-pages@v3.1.0 | ||
with: | ||
build_dir: project/docs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Set check-required on this | ||
success: | ||
needs: build | ||
if: always() | ||
runs-on: ubuntu-latest | ||
name: 'All check passes' | ||
steps: | ||
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | ||
name: 'Fail when previous jobs fails' | ||
run: | | ||
echo "::error::One of the previous jobs failed" | ||
exit 1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
htmldocs/* | ||
tests/t* | ||
!tests/t*.nim | ||
nim.cfg | ||
bin | ||
deps | ||
.tool-versions | ||
examples/data/output.txt | ||
backlog.txt | ||
profile.coz | ||
nimblemeta.json | ||
perf.data | ||
perf.data.old | ||
heaptrack.*.zst |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,4 @@ | ||
# Package | ||
|
||
version = "0.1.0" | ||
author = "haxscramper" | ||
description = "Nim property based testing" | ||
license = "Apache-2.0" | ||
srcDir = "src" | ||
|
||
|
||
# Dependencies | ||
|
||
requires "nim >= 1.4.8" | ||
|
||
task docgen, "Generate documentation": | ||
exec "nim doc2 --project --warnings:off --outdir:. src/npbt.nim" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.