File tree Expand file tree Collapse file tree 5 files changed +54
-0
lines changed Expand file tree Collapse file tree 5 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Run tests
2
+
3
+ on :
4
+
5
+ push :
6
+ branches : [ master ]
7
+
8
+ pull_request :
9
+ branches : [ master ]
10
+
11
+
12
+ jobs :
13
+
14
+ test-on-ubuntu :
15
+
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - uses : actions/checkout@v2
19
+ - uses : technote-space/get-diff-action@v1
20
+ - name : Get the list of modified files only
21
+ run : docker build -t shellspec . && docker run -v $PWD:/app shellspec bash -c "cd /app && ./test.sh ${{ env.GIT_DIFF }}"
Original file line number Diff line number Diff line change
1
+ FROM ubuntu
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+ RUN apt update && apt install -y curl git expect
5
+ RUN git clone https://github.com/shellspec/shellspec.git \
6
+ && mkdir $HOME/bin/ \
7
+ && ln -s /shellspec/shellspec /usr/local/bin/
8
+ RUN apt remove git -y
9
+ RUN shellspec -v
10
+ WORKDIR /app
11
+ CMD shellspec
Original file line number Diff line number Diff line change
1
+ Describe " Installer script for"
2
+ Describe " hello"
3
+ It " should say hello!"
4
+ When call installers/hello/installer.sh
5
+ The output should eq " Hello!"
6
+ End
7
+ End
8
+ End
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # declare -a X
4
+ X=()
5
+
6
+ for word in " $@ " ; do
7
+ # echo $(dirname "$word")
8
+ X+=$( dirname " $word " | cut -d " /" -f " 1 2" ) " "
9
+ done
10
+
11
+ CHANGED=$( echo $X | tr ' ' ' \n' | sort | uniq | xargs)
12
+
13
+ echo " Running tests on $CHANGED "
14
+ shellspec $CHANGED -f d
You can’t perform that action at this time.
0 commit comments