@@ -23,48 +23,19 @@ jobs:
23
23
- name : Checkout
24
24
uses : actions/checkout@v4
25
25
26
- - name : Cache Bats dependencies
27
- id : cache-bats-libs
28
- uses : actions/cache@v4
29
- env :
30
- cache-name : cache-bats-libs
31
- with :
32
- path : " ${{ github.workspace }}/tests/test_helper"
33
- key : ${{ runner.os }}-tests-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} # not every submodules have package-lock.json? Weird
34
- # a new cache is created when the content of `package.json` change, or when the runner's operating system changes
35
- restore-keys : |
36
- ${{ runner.os }}-tests-${{ env.cache-name }}
37
- ${{ runner.os }}-tests-
38
- ${{ runner.os }}-
26
+ - name : Pull Bats Docker image
27
+ run : docker pull bats/bats:latest
39
28
40
- - name : Setup Bats and bats libs
41
- # provide subsequent steps with output from the step
42
- id : setup-bats
43
- uses : bats-core/bats-action@3.0.0
44
- timeout-minutes : 10
45
- # inputs
46
- with :
47
- # by default, Bats libs are installed in default location
48
- # the inputs are set to `/usr/lib/bats-LIB_NAME`
49
- # to enable caching Bats libs, installed them inside HOME directory
50
- # NOTE: works for linux/win/mac
51
- support-path : " ${{ github.workspace }}/tests/test_helper/bats-support"
52
- assert-path : " ${{ github.workspace }}/tests/test_helper/bats-assert"
53
- file-path : " ${{ github.workspace }}/tests/test_helper/bats-file"
54
- - name : Test script.sh
55
- shell : bash
56
- env :
57
- TERM : xterm
58
- run : bats tests/test.sh
59
- - name : Test template.sh
60
- shell : bash
61
- env :
62
- SCRIPT_NAME : template.sh
63
- TERM : xterm
64
- run : bats tests/test.sh
65
29
- name : Test clone_bash_template.sh
66
30
shell : bash
67
31
env :
68
- SCRIPT_NAME : template.sh
69
32
TERM : xterm
70
- run : bats tests/test_clone.sh
33
+ run : |
34
+ docker run \
35
+ --rm \
36
+ --user="$(id -u):$(id -g)" \
37
+ --network none \
38
+ --security-opt=no-new-privileges:true \
39
+ --volume="$PWD:/code:ro" \
40
+ bats/bats:latest \
41
+ /code/tests
0 commit comments