/ .gitlab-ci.yml
.gitlab-ci.yml
 1  stages:
 2    - quality
 3    - test
 4  
 5  .job_template: &job_definition
 6    variables:
 7      BASHER_ROOT: $CI_PROJECT_DIR/.basher
 8    before_script:
 9      - apk add --no-cache make git file
10      - git clone --depth=1 https://github.com/basherpm/basher "$BASHER_ROOT"
11      - export PATH="$BASHER_ROOT/bin:$PATH"
12      - eval "$(basher init -)"
13      - basher install bats-core/bats-core
14      - basher install ztombol/bats-assert
15      - basher install ztombol/bats-support
16      - basher link "$(pwd)" shellm/daemon
17  
18  .quality_template: &quality_definition
19    <<: *job_definition
20    image: bash:4.4
21    stage: quality
22  
23  style:
24    <<: *quality_definition
25    script:
26      - apk add --no-cache xz
27      - wget -q -O - https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz | tar xJ
28      - mv shellcheck-stable/shellcheck /usr/bin/shellcheck
29      - rm -rf shellcheck-stable
30      - make check-style
31  
32  documentation:
33    <<: *quality_definition
34    script:
35      - make check-documentation
36  
37  .test_template: &test_definition
38    <<: *job_definition
39    stage: test
40    script:
41      - make test
42  
43  bash-4.3:
44    <<: *test_definition
45    image: bash:4.3
46  
47  bash-4.4:
48    <<: *test_definition
49    image: bash:4.4
50  
51  bash-5.0:
52    <<: *test_definition
53    image: bash:5.0-beta