bat-extras/.circleci/config.yml

104 lines
3.0 KiB
YAML
Raw Normal View History

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."
command: apk add git openssh bash python2 diffutils ca-certificates curl shfmt
- run:
2020-03-31 23:49:34 +02:00
name: "Setup: Install test packages."
command: apk add util-linux coreutils
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"
steps:
- run:
2020-03-31 23:49:34 +02:00
name: "Build"
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
2020-05-16 06:13:15 +02:00
- run:
name: "Build Manuals"
command: ./build.sh --no-verify --manuals
2019-06-20 02:33:06 +02:00
- build:
2020-03-31 23:49:34 +02:00
minify: "all"
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
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"
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
- 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]