bat-extras/.circleci/config.yml
2019-10-22 15:00:35 -07:00

96 lines
2.5 KiB
YAML

version: 2.1
executors:
linux_alpine:
docker:
- image: alpine:latest
environment:
TERM: xterm
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."
command: apk add git bash python2 diffutils ca-certificates curl
- run:
name: "Setup: Install runtime packages."
command: apk add bat ripgrep ncurses
build:
description: "Build the self-contained scripts."
parameters:
minify:
type: string
default: "lib"
steps:
- run:
name: "Build"
command: ./build.sh --minify=<<parameters.minify>> --no-verify
jobs:
build:
executor: linux_alpine
steps:
- setup
- checkout
- build:
minify: "all"
- store_artifacts:
path: bin
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
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
workflows:
version: 2
default:
jobs:
- build
- test-snapshots:
requires: [build]
- test-consistency:
requires: [build]
- test-symlink:
requires: [build]