2019-06-20 02:33:06 +02:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
executors:
|
|
|
|
linux_alpine:
|
|
|
|
docker:
|
|
|
|
- image: alpine:latest
|
2019-06-20 02:37:16 +02:00
|
|
|
environment:
|
|
|
|
TERM: xterm
|
2019-06-20 02:33:06 +02:00
|
|
|
|
|
|
|
commands:
|
|
|
|
setup:
|
|
|
|
description: "Set up the environment needed to test and run the scripts."
|
|
|
|
steps:
|
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "APK: Add repository."
|
|
|
|
command: |
|
|
|
|
printf "\n%s\n" "http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
|
|
|
|
printf "\n%s\n" "http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
|
2019-06-20 02:33:06 +02:00
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "APK: Update cache."
|
|
|
|
command: apk update
|
2019-06-20 02:33:06 +02:00
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "Setup: Install build packages."
|
2021-03-31 04:44:43 +02:00
|
|
|
command: apk add git openssh bash python3 diffutils ca-certificates curl shfmt
|
2019-12-24 02:49:34 +01:00
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "Setup: Install test packages."
|
2021-03-31 04:45:10 +02:00
|
|
|
command: apk add util-linux coreutils fish
|
2019-06-20 02:33:06 +02:00
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "Setup: Install runtime packages."
|
|
|
|
command: apk add bat ripgrep ncurses
|
2019-06-20 02:33:06 +02:00
|
|
|
|
|
|
|
build:
|
|
|
|
description: "Build the self-contained scripts."
|
|
|
|
parameters:
|
|
|
|
minify:
|
|
|
|
type: string
|
|
|
|
default: "lib"
|
2021-03-31 04:57:01 +02:00
|
|
|
manuals:
|
|
|
|
type: string
|
|
|
|
default: "false"
|
2019-06-20 02:33:06 +02:00
|
|
|
steps:
|
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "Build"
|
2021-03-31 04:57:01 +02:00
|
|
|
command: ./build.sh --minify=<<parameters.minify>> --manuals=<<parameters.manuals>> --no-verify
|
2019-06-20 02:33:06 +02:00
|
|
|
|
2019-06-20 01:54:34 +02:00
|
|
|
jobs:
|
2019-06-20 02:33:06 +02:00
|
|
|
build:
|
|
|
|
executor: linux_alpine
|
|
|
|
steps:
|
|
|
|
- setup
|
|
|
|
- checkout
|
|
|
|
- build:
|
2020-03-31 23:49:34 +02:00
|
|
|
minify: "all"
|
2021-03-31 04:57:01 +02:00
|
|
|
manuals: "true"
|
|
|
|
- build:
|
|
|
|
minify: "all"
|
|
|
|
manuals: "true"
|
2019-06-21 23:50:34 +02:00
|
|
|
- store_artifacts:
|
2020-03-31 23:49:34 +02:00
|
|
|
path: bin
|
2020-05-16 06:13:15 +02:00
|
|
|
- store_artifacts:
|
|
|
|
path: man
|
2019-06-20 02:33:06 +02:00
|
|
|
|
2020-02-20 06:02:58 +01:00
|
|
|
test:
|
2019-06-20 02:33:06 +02:00
|
|
|
executor: linux_alpine
|
|
|
|
steps:
|
|
|
|
- setup
|
|
|
|
- checkout
|
|
|
|
- build:
|
2020-03-31 23:49:34 +02:00
|
|
|
minify: "all"
|
2019-06-20 02:33:06 +02:00
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "Test: Unit Tests / Snapshots"
|
2020-04-06 14:03:20 +02:00
|
|
|
command: ./test.sh --verbose --strict --snapshot:show
|
2019-06-20 02:33:06 +02:00
|
|
|
|
|
|
|
test-consistency:
|
|
|
|
executor: linux_alpine
|
|
|
|
steps:
|
|
|
|
- setup
|
|
|
|
- checkout
|
|
|
|
- build:
|
2020-03-31 23:49:34 +02:00
|
|
|
minify: "all"
|
2019-06-20 02:33:06 +02:00
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "Test: Consistency"
|
|
|
|
command: ./test.sh --compiled --verbose --snapshot:show
|
2019-06-20 02:33:06 +02:00
|
|
|
|
2019-10-23 00:00:35 +02:00
|
|
|
test-symlink:
|
|
|
|
executor: linux_alpine
|
|
|
|
steps:
|
|
|
|
- setup
|
|
|
|
- checkout
|
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "Symlink"
|
|
|
|
command: ln -s "$PWD/src/batgrep.sh" /tmp/batgrep
|
2019-10-23 00:00:35 +02:00
|
|
|
- run:
|
2020-03-31 23:49:34 +02:00
|
|
|
name: "Test: Symlink"
|
|
|
|
command: /tmp/batgrep 'a' >/dev/null
|
2019-06-20 02:33:06 +02:00
|
|
|
|
2019-06-20 01:54:34 +02:00
|
|
|
workflows:
|
2019-06-20 02:33:06 +02:00
|
|
|
version: 2
|
|
|
|
default:
|
|
|
|
jobs:
|
|
|
|
- build
|
2020-02-20 06:02:58 +01:00
|
|
|
- test:
|
2020-03-31 23:49:34 +02:00
|
|
|
requires: [build]
|
2019-06-20 02:33:06 +02:00
|
|
|
- test-consistency:
|
2020-03-31 23:49:34 +02:00
|
|
|
requires: [build, test]
|
2019-10-23 00:00:35 +02:00
|
|
|
- test-symlink:
|
2020-03-31 23:49:34 +02:00
|
|
|
requires: [build]
|