Skip to content

Commit 141cb15

Browse files
authored
feat: support windows and macos (#15)
1 parent 3b6fd9e commit 141cb15

7 files changed

+359
-149
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Test local action inside $HOME"
1+
name: CI
22
on:
33
workflow_dispatch:
44
pull_request:
@@ -13,17 +13,17 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
17-
runs-on: ubuntu-latest
16+
version: ["1.7.0", "1.9.0", "1.11.0", "latest"]
17+
os: [ ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
18+
runs-on: ${{ matrix.os }}
1819
env:
19-
BATS_LIB_PATH: "${{ github.workspace }}/tests"
2020
TERM: xterm
21-
name: local default
21+
name: local-inside-home
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@v4
2525
- name: Setup Bats and Bats libs
26-
id: bats-action
26+
id: setup-bats
2727
uses: ./
2828
with:
2929
bats-version: ${{ matrix.version }}
@@ -36,30 +36,51 @@ jobs:
3636
file-clean: "false"
3737
file-path: "${{ github.workspace }}/tests/bats-file"
3838
- name: Execute test to check Bats-support
39-
if: steps.bats-action.outputs.support-installed == 'true'
39+
if: steps.setup-bats.outputs.support-installed == 'true'
40+
shell: bash
41+
env:
42+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
43+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
4044
run: |
41-
cd /tmp/bats-support/
45+
cd ${TMP_PATH}/bats-support/
4246
bats test
43-
- name: Execute test to check Bats-assert
44-
if: steps.bats-action.outputs.assert-installed == 'true'
47+
- name: Execute test to check Bats-assert
48+
if: steps.setup-bats.outputs.assert-installed == 'true'
49+
shell: bash
50+
env:
51+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
52+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
4553
run: |
46-
ls -l $BATS_LIB_PATH/
47-
cd /tmp/bats-assert/
54+
cd ${TMP_PATH}/bats-assert/
4855
bats test
4956
- name: Execute test to check Bats-detik
50-
if: steps.bats-action.outputs.detik-installed == 'true'
57+
if: steps.setup-bats.outputs.detik-installed == 'true'
58+
# Currently the bats-detik tests are broken
59+
# in macos
60+
continue-on-error: ${{ runner.os == 'macOS' }}
61+
shell: bash
62+
env:
63+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
64+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
5165
run: |
52-
cd /tmp/bats-detik/
66+
cd ${TMP_PATH}/bats-detik/
5367
bats tests
5468
- name: Execute test to check Bats-file
55-
if: steps.bats-action.outputs.file-installed == 'true'
69+
if: steps.setup-bats.outputs.file-installed == 'true'
70+
shell: bash
71+
env:
72+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
73+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
5674
# Currently the bats-file tests are broken
5775
# in gh runner env
5876
continue-on-error: true
5977
run: |
60-
cd /tmp/bats-file/
78+
cd ${TMP_PATH}/bats-file/
6179
bats test
6280
- name: Execute example tests
81+
shell: bash
82+
env:
83+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
6384
run: |
6485
echo $PATH
6586
bats -T -p tests
@@ -70,16 +91,16 @@ jobs:
7091
fail-fast: false
7192
matrix:
7293
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
73-
runs-on: ubuntu-latest
94+
os: [ ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
95+
runs-on: ${{ matrix.os }}
7496
env:
75-
BATS_LIB_PATH: "${{ github.workspace }}/tests"
7697
TERM: xterm
77-
name: local default cache
98+
name: local-inside-home-cache
7899
steps:
79100
- name: Checkout
80101
uses: actions/checkout@v4
81102
- name: Setup Bats and Bats libs
82-
id: bats-action
103+
id: setup-bats
83104
uses: ./
84105
with:
85106
bats-version: ${{ matrix.version }}
@@ -91,29 +112,9 @@ jobs:
91112
detik-path: "${{ github.workspace }}/tests/bats-detik"
92113
file-clean: "false"
93114
file-path: "${{ github.workspace }}/tests/bats-file"
94-
- name: Execute test to check Bats-support
95-
if: steps.bats-action.outputs.support-installed == 'true'
96-
run: |
97-
cd /tmp/bats-support/
98-
bats test
99-
- name: Execute test to check Bats-assert
100-
if: steps.bats-action.outputs.assert-installed == 'true'
101-
run: |
102-
cd /tmp/bats-assert/
103-
bats test
104-
- name: Execute test to check Bats-detik
105-
if: steps.bats-action.outputs.detik-installed == 'true'
106-
run: |
107-
cd /tmp/bats-detik/
108-
bats tests
109-
- name: Execute test to check Bats-file
110-
if: steps.bats-action.outputs.file-installed == 'true'
111-
# Currently the bats-file tests are broken
112-
# in gh runner env
113-
continue-on-error: true
114-
run: |
115-
cd /tmp/bats-file/
116-
bats test
117115
- name: Execute example tests
116+
shell: bash
117+
env:
118+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
118119
run:
119120
bats -T -p tests

.github/workflows/test-local-action-with-conditionals.yaml

+20-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Test local with conditionals"
1+
name: CI
22
on:
33
workflow_dispatch:
44
pull_request:
@@ -13,16 +13,17 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
17-
runs-on: ubuntu-latest
16+
version: ["1.7.0", "1.9.0", "1.11.0", "latest"]
17+
os: [ ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
18+
runs-on: ${{ matrix.os }}
1819
env:
19-
BATS_LIB_PATH: "/usr/lib"
2020
TERM: xterm
21-
name: local with options
21+
name: local-options
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@v4
2525
- name: Setup Bats and Bats libs
26+
id: setup-bats
2627
uses: ./
2728
with:
2829
bats-version: ${{ matrix.version }}
@@ -31,13 +32,25 @@ jobs:
3132
detik-install: "true"
3233
file-install: "true"
3334
- name: Execute test to check Bats-support
35+
shell: bash
36+
env:
37+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
38+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
3439
run: |
35-
cd /tmp/bats-support/
40+
cd ${TMP_PATH}/bats-support/
3641
bats test
3742
- name: Execute test to check Bats-assert
43+
shell: bash
44+
env:
45+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
46+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
3847
run: |
39-
cd /tmp/bats-assert/
48+
cd ${TMP_PATH}/bats-assert/
4049
bats test
4150
- name: Execute example tests
51+
shell: bash
52+
env:
53+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
54+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
4255
run:
4356
bats -T -p tests
+40-32
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Test local action"
1+
name: CI
22
on:
33
workflow_dispatch:
44
pull_request:
@@ -13,17 +13,17 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
17-
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest ]
16+
version: ["1.7.0", "1.9.0", "1.11.0", "latest"]
17+
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
1818
runs-on: ${{ matrix.os }}
1919
env:
20-
BATS_LIB_PATH: "/usr/lib"
2120
TERM: xterm
22-
name: local default
21+
name: local
2322
steps:
2423
- name: Checkout
2524
uses: actions/checkout@v4
2625
- name: Setup Bats and Bats libs
26+
id: setup-bats
2727
uses: ./
2828
with:
2929
bats-version: ${{ matrix.version }}
@@ -32,25 +32,46 @@ jobs:
3232
detik-clean: "false"
3333
file-clean: "false"
3434
- name: Execute test to check Bats-support
35+
shell: bash
36+
env:
37+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
38+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
3539
run: |
36-
cd /tmp/bats-support/
40+
cd ${TMP_PATH}/bats-support/
41+
echo $BATS_LIB_PATH
3742
bats test
3843
- name: Execute test to check Bats-assert
44+
shell: bash
45+
env:
46+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
47+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
3948
run: |
40-
cd /tmp/bats-assert/
49+
cd ${TMP_PATH}/bats-assert/
4150
bats test
4251
- name: Execute test to check Bats-detik
52+
shell: bash
53+
continue-on-error: true
54+
env:
55+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
56+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
4357
run: |
44-
cd /tmp/bats-detik/
58+
cd ${TMP_PATH}/bats-detik/
4559
bats tests
4660
- name: Execute test to check Bats-file
61+
shell: bash
4762
# Currently the bats-file tests are broken
4863
# in gh runner env
4964
continue-on-error: true
65+
env:
66+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
67+
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
5068
run: |
51-
cd /tmp/bats-file/
69+
cd ${TMP_PATH}/bats-file/
5270
bats test
5371
- name: Execute example tests
72+
env:
73+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
74+
shell: bash
5475
run:
5576
bats -T -p tests
5677

@@ -59,40 +80,27 @@ jobs:
5980
strategy:
6081
fail-fast: false
6182
matrix:
62-
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
63-
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest ]
83+
version: ["1.7.0", "1.9.0", "1.11.0", "latest"]
84+
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
6485
runs-on: ${{ matrix.os }}
6586
env:
66-
BATS_LIB_PATH: "/usr/lib"
6787
TERM: xterm
68-
name: local default cache
88+
name: local-default-no-cache
6989
steps:
7090
- name: Checkout
7191
uses: actions/checkout@v4
7292
- name: Setup Bats and Bats libs
7393
uses: ./
94+
id: setup-bats
7495
with:
7596
bats-version: ${{ matrix.version }}
7697
support-clean: "false"
7798
assert-clean: "false"
7899
detik-clean: "false"
79100
file-clean: "false"
80-
- name: Execute test to check Bats-support
81-
run: |
82-
cd /tmp/bats-support/
83-
bats test
84-
- name: Execute test to check Bats-assert
85-
run: |
86-
cd /tmp/bats-assert/
87-
bats test
88-
- name: Execute test to check Bats-detik
89-
run: |
90-
cd /tmp/bats-detik/
91-
bats tests
92-
- name: Execute test to check Bats-file
93-
# Currently the bats-file tests are broken
94-
# in gh runner env
95-
continue-on-error: true
96-
run: |
97-
cd /tmp/bats-file/
98-
bats test
101+
- name: Execute example tests
102+
env:
103+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
104+
shell: bash
105+
run:
106+
bats -T -p tests

0 commit comments

Comments
 (0)