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:
|
|
|
|
name: "APK: Add repository."
|
|
|
|
command: printf "\n%s\n" "http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
|
|
|
|
- run:
|
|
|
|
name: "APK: Update cache."
|
|
|
|
command: apk update
|
|
|
|
- run:
|
|
|
|
name: "Setup: Install build packages."
|
2019-10-23 00:00:35 +02:00
|
|
|
command: apk add git bash python2 diffutils ca-certificates curl
|
2019-12-24 02:49:34 +01:00
|
|
|
- run:
|
|
|
|
name: "Setup: Install test packages."
|
2020-01-19 00:37:44 +01:00
|
|
|
command: apk add util-linux coreutils
|
2019-06-20 02:33:06 +02:00
|
|
|
- run:
|
|
|
|
name: "Setup: Install runtime packages."
|
2019-06-20 02:37:16 +02:00
|
|
|
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"
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: "Build"
|
2019-09-27 00:50:58 +02:00
|
|
|
command: ./build.sh --minify=<<parameters.minify>> --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:
|
|
|
|
minify: "all"
|
2019-06-21 23:50:34 +02:00
|
|
|
- store_artifacts:
|
|
|
|
path: bin
|
2019-06-20 02:33:06 +02:00
|
|
|
|
|
|
|
test-snapshots:
|
|
|
|
executor: linux_alpine
|
|
|
|
steps:
|
|
|
|
- setup
|
|
|
|
- checkout
|
|
|
|
- build:
|
|
|
|
minify: "all"
|
|
|
|
- run:
|
|
|
|
name: "Test: Snapshots"
|
|
|
|
command: test/run.sh snapshot-test
|
|
|
|
|
|
|
|
test-consistency:
|
|
|
|
executor: linux_alpine
|
|
|
|
steps:
|
|
|
|
- setup
|
|
|
|
- checkout
|
|
|
|
- build:
|
|
|
|
minify: "all"
|
|
|
|
- run:
|
|
|
|
name: "Test: Consistency"
|
|
|
|
command: test/run.sh consistency-test
|
|
|
|
|
2019-10-23 00:00:35 +02:00
|
|
|
test-symlink:
|
|
|
|
executor: linux_alpine
|
|
|
|
steps:
|
|
|
|
- setup
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: "Symlink"
|
|
|
|
command: ln -s "$PWD/src/batgrep.sh" /tmp/batgrep
|
|
|
|
- run:
|
|
|
|
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
|
|
|
|
- test-snapshots:
|
|
|
|
requires: [build]
|
|
|
|
- test-consistency:
|
|
|
|
requires: [build]
|
2019-10-23 00:00:35 +02:00
|
|
|
- test-symlink:
|
|
|
|
requires: [build]
|
2019-06-20 01:54:34 +02:00
|
|
|
|