Skip to content

Commit

Permalink
WIP: better themes; splitting CI into jobs (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
kigster authored Apr 6, 2021
1 parent d4c4219 commit 663476a
Show file tree
Hide file tree
Showing 21 changed files with 682 additions and 152 deletions.
116 changes: 94 additions & 22 deletions .asciidoc-pdf-theme.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,94 @@
extends: default
base:
border-color: 303030
font:
size: 11
color: 222222
family: Barlow
line-height-length: 13
line-height: $base-line-height-length / $base-font-size
vertical-spacing: $base-line-height-length
code:
background-color: 191919
font-color: $base-font-color
border-color: 303030
line-height-length: 12
line-height: $code-line-height-length / $code-font-size
font:
size: 9
family: Cascadia
heading:
line-height-length: 20
line-height: $heading-line-height-length / $heading-font-size
font:
color: BF5F10
family: Cairo
style: bold
size: 15
image:
border-radius: 15
admonition:
column-rule-color: $base-border-color
icon:
caution:
stroke-color: D6A623
note:
stroke-color: 1040A3
tip:
stroke-color: 609000
warning:
stroke-color: E6A623
link:
font-color: 2353FF
literal:
font-color: 102840
mark:
background-color: 0030A0
key:
background-color: F0F0FF
border-color: A0A0A0
heading:
font-color: $base-font-color
title_page:
title:
font-color: E09000
authors:
font-color: B06000
abstract:
font-color:
blockquote:
border-color: $base-border-color
cite:
font-color: 503004
background-color: 9F7987
verse:
border-color: $blockquote-border-color
cite:
font-color: $blockquote-cite-font-color
conum:
font-color: $literal-font-color
example:
background-color: $page-background-color
border-color: $base-border-color
sidebar:
background-color: 111111
border-color: 1A1A1A
title:
font-color: $heading-font-color
thematic-break:
border-color: $base-border-color
table:
background-color: $page-background-color
border-color: 222222
foot:
background-color: $table-background-color
header:
font-color: 666666
footer:
border-color: 222222
font:
catalog:
merge: true # set value to true to merge catalog with theme you're extending
merge: true set value to true to merge catalog with theme you're extending
Barlow:
bold: barlowcondensed-semibold.ttf
bold_italic: barlowcondensed-semibolditalic.ttf
Expand All @@ -26,30 +114,14 @@ font:
italic: arvo-italic.ttf
normal: arvo-regular.ttf
Cascadia:
normal: cascadiamono-regular.ttf
bold: cascadiamono-bold.ttf
normal: cascadiamono-light.ttf
bold: cascadiamono-semibold.ttf
bold_italic: cascadiamono-semibold.ttf
italic: cascadiamono-semilight.ttf
extends: default
semibold: cascadiamono-regular.ttf
page:
background-color: FFFFFF
layout: portrait
margin: [0.75in, 1in, 0.75in, 1in]
size: Letter
base:
font:
size: 12
line-height-length: 15
line-height: $base-line-height-length / $base-font-size
family: Barlow
code:
font:
size: 9
line-height-length: 13
family: Cascadia
line-height: $base-line-height-length / $base-font-size
heading:
font:
family: AdventPro
style: bold
image:
border-radius: 15

53 changes: 0 additions & 53 deletions .github/workflows/ci.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install ShellCheck
run: |
scversion="stable" # or "v0.4.7", or "latest"
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv
mkdir -p ${HOME}/bin
cp -v "shellcheck-${scversion}/shellcheck" ${HOME}/bin
${HOME}/bin/shellcheck --version
- name: ShellCheck
run: |
${HOME}/bin/shellcheck -a $(find {bin,lib} -type f) || true
echo; echo; echo
${HOME}/bin/shellcheck -a $(find {bin,lib} -type f) | egrep -c '^In ' || true
43 changes: 43 additions & 0 deletions .github/workflows/parallel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Parallel
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.1-alpine
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# needed because the postgres container does not provide a health check
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
- uses: ./
id: cpu-count
- name: Run Tests in Parallel
env:
TERM: xterm-256color
MIN_WIDTH: 80
run: |
export CPU_COUNT="$(cat /proc/cpuinfo | grep processor | wc -l)"
tput setab n; tput clear
source init.sh
output.constrain-screen-width ${MIN_WIDTH}
note "Running specs with CPU_COUNT=${CPU_COUNT}"
h1 ".bats-prefix/bin/bats --pretty -T -j ${CPU_COUNT:-8}" $(find test -name '*_test.bats' -type f)
.bats-prefix/bin/bats --pretty -T -j "${CPU_COUNT:-8}" $(find test -name '*_test.bats' -type f) || {
code=$?
error "Parallel Tests failed with exit code ${code}"
warning "Ignoring parallel test failure...."
}
true
27 changes: 27 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.1-alpine
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# needed because the postgres container does not provide a health check
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
- name: Test
env:
TERM: xterm-256color
MIN_WIDTH: 80
run: bin/specs -t -c
25 changes: 24 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# vim: noexpandtab

# grep '^[a-z\-]*:' Makefile | cut -d: -f 1 | tr '\n' ' '
.PHONY: help install fonts-setup fonts-clean update-changelog update-functions update-usage update-readme regenerate-readme reduce-size-readme open-readme git-add update setup test
.PHONY: help install fonts-setup fonts-clean update-changelog update-functions update-usage update-readme regenerate-readme reduce-size-readme open-readme git-add update setup test docker-build docker-run docker-run-bash docker-run-zsh docker-run-fish file-stats-git file-stats-local shell-files

red := \033[0;31m
bold := \033[1;45m
Expand Down Expand Up @@ -49,6 +49,29 @@ fonts-setup:

fonts-clean:
@bash -c 'rm -rf .fonts'


file-stats-local: ## Print all non-test files and run `file` utility on them.
@find . -type f \! -ipath '*\.git*' -and ! -ipath '*\.bundle*' -and ! -ipath '*\.bats*' | sed 's/^\.\///g' | xargs file

shell-files: ## Lists every single checked in SHELL file in this repo
@find . -type f \! -ipath '*\.git*' -and ! -ipath '*\.bundle*' -and ! -ipath '*\.bats*' | sed 's/^\.\///g' | xargs file | grep Bourne | awk '{print $1}'

make-utf8: ## Convert all text SHELL script files from ASCII to UTF8 format
@bash -c "
function to-utf8() {
FROM_ENCODING="$1"
TO_ENCODING="UTF-8"
CONVERT="iconv -f $FROM_ENCODING -t $TO_ENCODING"
#loop to convert multiple files
for file in *.txt; do
$CONVERT "$file" -o "${file%.txt}.utf8.converted"
done
exit 0

file-stats-git: ## Print all files known to `git ls-files` command
@git ls-files | xargs files


update-changelog: ## Auto-generate the doc/CHANGELOG (requires GITHUB_TOKEN env var set)
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Regenerating CHANGELOG....$(clear)\n"
Expand Down
Loading

0 comments on commit 663476a

Please sign in to comment.