-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
7316869
commit 810e094
Showing
6 changed files
with
172 additions
and
47 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,65 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
# CI shouldn't need to run on the main branch, | ||
# just working & PR branches | ||
branches-ignore: | ||
- main | ||
- master | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 20 | ||
matrix: | ||
branch: [master] | ||
target: | ||
- nim_version: 1.2.8 | ||
os: linux | ||
- nim_version: 1.4.2 | ||
os: linux | ||
- nim_version: 1.2.8 | ||
os: macos | ||
- nim_version: 1.4.2 | ||
os: macos | ||
include: | ||
- target: | ||
os: linux | ||
builder: ubuntu-18.04 | ||
- target: | ||
os: macos | ||
builder: macos-10.15 | ||
|
||
name: '${{ matrix.target.os }}-nim${{ matrix.target.nim_version }} (${{ matrix.branch }})' | ||
runs-on: ${{ matrix.builder }} | ||
|
||
steps: | ||
- name: "[Git] Checkout code" | ||
uses: actions/checkout@v2 | ||
- name: "[Setup] Configure caching" | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.asdf | ||
key: ${{ matrix.target.os }}-nim${{ matrix.target.nim_version }}-${{ hashFiles('**/lockfiles') }} | ||
- name: "[Setup] Install deps" | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-fast update -qq | ||
sudo apt-fast --no-install-recommends -yq install curl git | ||
- name: "[Setup] Install asdf" | ||
run: | | ||
[ -d ~/.asdf ] || git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.0 | ||
- name: "[Setup] Install nim dependencies" | ||
run: | | ||
source $HOME/.asdf/asdf.sh | ||
[ -e $(asdf plugin list|grep nim) ] && asdf plugin add nim | ||
asdf install nim ${{ matrix.target.nim_version }} | ||
- name: "[Test] Run tests" | ||
run: | | ||
source $HOME/.asdf/asdf.sh | ||
asdf info | ||
asdf global nim ${{ matrix.target.nim_version }} | ||
make test |
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,45 @@ | ||
name: Create Release | ||
|
||
on: | ||
# Trigger this workflow on push (merge) events, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "[Git] Checkout code" | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "[Version] Install" | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
|
||
- name: "[Version] Calculate" | ||
id: gitversion # step id used as reference for output values | ||
uses: gittools/actions/gitversion/[email protected] | ||
|
||
- name: "[Version] Capture" | ||
run: echo "RELEASE_VERSION=${{ steps.gitversion.outputs.semVer }}" >> $GITHUB_ENV | ||
|
||
- name: "[Release] Create" | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{env.RELEASE_VERSION}} | ||
release_name: ${{env.RELEASE_VERSION}} | ||
body: | | ||
Please see the changelog for details of this release | ||
draft: false | ||
prerelease: false |
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 |
---|---|---|
|
@@ -562,3 +562,4 @@ nimcache/ | |
/ll | ||
/src/ll | ||
profile_results.txt | ||
/tests/all.*/ | ||
|
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,40 +1,32 @@ | ||
define usage | ||
Options: | ||
build development build | ||
test run test suite | ||
fulltest run test suite within a local Travis-CI container | ||
release release build, optimised for speed | ||
install build a release version then mv to /usr/local/bin | ||
clean remove build artefacts | ||
endef | ||
export usage | ||
|
||
.PHONY: all release build test profile clean help | ||
|
||
all: test | ||
all: release | ||
|
||
build: | ||
build: ## development build | ||
@nim c src/ll.nim | ||
|
||
test: | ||
@nimble test | ||
test: ## run test suite | ||
@nimble -y test --verbose | ||
|
||
profile: | ||
profile: ## run profiler | ||
@nimble profile | ||
|
||
fulltest: | ||
@docker-compose -f .docker-compose.yml up --build | ||
|
||
release: | ||
@nimble build --nilseqs:on --verbose --opt:speed -d:release # --passC:-Ofast --threads:off --threadanalysis:off | ||
release: ## release build, optimised for speed | ||
@nimble -y build --nilseqs:on --verbose --opt:speed -d:release # --passC:-Ofast --threads:off --threadanalysis:off | ||
|
||
install: release | ||
install: release ## create a release build and install to /usr/local/bin | ||
@mv ./ll /usr/local/bin/ll | ||
|
||
clean: | ||
clean: ## remove build artefacts | ||
@find . -type d -iname 'nimcache' | xargs rm -rf | ||
@rm -f ll | ||
@rm -f src/ll | ||
|
||
help: | ||
@echo "$$usage" | ||
help: ## display this help | ||
@echo "Options:" | ||
@grep -E '^[a-zA-Z%_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | ||
@grep -E '^[a-zA-Z%_-]+:.*?##@deprecated.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?##@deprecated "}; {printf " \033[31m%-18s\033[0m [deprecated] %s\n", $$1, $$2}' | ||
|
||
# catch-all | ||
%: | ||
@: |
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
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