Skip to content

Commit c759807

Browse files
add some more #8
1 parent 5078a50 commit c759807

File tree

1 file changed

+11
-40
lines changed

1 file changed

+11
-40
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,48 +23,19 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v4
2525

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
3928

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
6529
- name: Test clone_bash_template.sh
6630
shell: bash
6731
env:
68-
SCRIPT_NAME: template.sh
6932
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

Comments
 (0)