Skip to content

Commit

Permalink
feat: support windows and macos (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
brokenpip3 authored Sep 29, 2024
1 parent 3b6fd9e commit 141cb15
Show file tree
Hide file tree
Showing 7 changed files with 359 additions and 149 deletions.
87 changes: 44 additions & 43 deletions .github/workflows/test-local-action-inside-home.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test local action inside $HOME"
name: CI
on:
workflow_dispatch:
pull_request:
Expand All @@ -13,17 +13,17 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
runs-on: ubuntu-latest
version: ["1.7.0", "1.9.0", "1.11.0", "latest"]
os: [ ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
runs-on: ${{ matrix.os }}
env:
BATS_LIB_PATH: "${{ github.workspace }}/tests"
TERM: xterm
name: local default
name: local-inside-home
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bats and Bats libs
id: bats-action
id: setup-bats
uses: ./
with:
bats-version: ${{ matrix.version }}
Expand All @@ -36,30 +36,51 @@ jobs:
file-clean: "false"
file-path: "${{ github.workspace }}/tests/bats-file"
- name: Execute test to check Bats-support
if: steps.bats-action.outputs.support-installed == 'true'
if: steps.setup-bats.outputs.support-installed == 'true'
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
cd /tmp/bats-support/
cd ${TMP_PATH}/bats-support/
bats test
- name: Execute test to check Bats-assert
if: steps.bats-action.outputs.assert-installed == 'true'
- name: Execute test to check Bats-assert
if: steps.setup-bats.outputs.assert-installed == 'true'
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
ls -l $BATS_LIB_PATH/
cd /tmp/bats-assert/
cd ${TMP_PATH}/bats-assert/
bats test
- name: Execute test to check Bats-detik
if: steps.bats-action.outputs.detik-installed == 'true'
if: steps.setup-bats.outputs.detik-installed == 'true'
# Currently the bats-detik tests are broken
# in macos
continue-on-error: ${{ runner.os == 'macOS' }}
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
cd /tmp/bats-detik/
cd ${TMP_PATH}/bats-detik/
bats tests
- name: Execute test to check Bats-file
if: steps.bats-action.outputs.file-installed == 'true'
if: steps.setup-bats.outputs.file-installed == 'true'
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
# Currently the bats-file tests are broken
# in gh runner env
continue-on-error: true
run: |
cd /tmp/bats-file/
cd ${TMP_PATH}/bats-file/
bats test
- name: Execute example tests
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
run: |
echo $PATH
bats -T -p tests
Expand All @@ -70,16 +91,16 @@ jobs:
fail-fast: false
matrix:
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
runs-on: ubuntu-latest
os: [ ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
runs-on: ${{ matrix.os }}
env:
BATS_LIB_PATH: "${{ github.workspace }}/tests"
TERM: xterm
name: local default cache
name: local-inside-home-cache
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bats and Bats libs
id: bats-action
id: setup-bats
uses: ./
with:
bats-version: ${{ matrix.version }}
Expand All @@ -91,29 +112,9 @@ jobs:
detik-path: "${{ github.workspace }}/tests/bats-detik"
file-clean: "false"
file-path: "${{ github.workspace }}/tests/bats-file"
- name: Execute test to check Bats-support
if: steps.bats-action.outputs.support-installed == 'true'
run: |
cd /tmp/bats-support/
bats test
- name: Execute test to check Bats-assert
if: steps.bats-action.outputs.assert-installed == 'true'
run: |
cd /tmp/bats-assert/
bats test
- name: Execute test to check Bats-detik
if: steps.bats-action.outputs.detik-installed == 'true'
run: |
cd /tmp/bats-detik/
bats tests
- name: Execute test to check Bats-file
if: steps.bats-action.outputs.file-installed == 'true'
# Currently the bats-file tests are broken
# in gh runner env
continue-on-error: true
run: |
cd /tmp/bats-file/
bats test
- name: Execute example tests
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
run:
bats -T -p tests
27 changes: 20 additions & 7 deletions .github/workflows/test-local-action-with-conditionals.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test local with conditionals"
name: CI
on:
workflow_dispatch:
pull_request:
Expand All @@ -13,16 +13,17 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
runs-on: ubuntu-latest
version: ["1.7.0", "1.9.0", "1.11.0", "latest"]
os: [ ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
runs-on: ${{ matrix.os }}
env:
BATS_LIB_PATH: "/usr/lib"
TERM: xterm
name: local with options
name: local-options
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bats and Bats libs
id: setup-bats
uses: ./
with:
bats-version: ${{ matrix.version }}
Expand All @@ -31,13 +32,25 @@ jobs:
detik-install: "true"
file-install: "true"
- name: Execute test to check Bats-support
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
cd /tmp/bats-support/
cd ${TMP_PATH}/bats-support/
bats test
- name: Execute test to check Bats-assert
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
cd /tmp/bats-assert/
cd ${TMP_PATH}/bats-assert/
bats test
- name: Execute example tests
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run:
bats -T -p tests
72 changes: 40 additions & 32 deletions .github/workflows/test-local-action.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test local action"
name: CI
on:
workflow_dispatch:
pull_request:
Expand All @@ -13,17 +13,17 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest ]
version: ["1.7.0", "1.9.0", "1.11.0", "latest"]
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
runs-on: ${{ matrix.os }}
env:
BATS_LIB_PATH: "/usr/lib"
TERM: xterm
name: local default
name: local
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bats and Bats libs
id: setup-bats
uses: ./
with:
bats-version: ${{ matrix.version }}
Expand All @@ -32,25 +32,46 @@ jobs:
detik-clean: "false"
file-clean: "false"
- name: Execute test to check Bats-support
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
cd /tmp/bats-support/
cd ${TMP_PATH}/bats-support/
echo $BATS_LIB_PATH
bats test
- name: Execute test to check Bats-assert
shell: bash
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
cd /tmp/bats-assert/
cd ${TMP_PATH}/bats-assert/
bats test
- name: Execute test to check Bats-detik
shell: bash
continue-on-error: true
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
cd /tmp/bats-detik/
cd ${TMP_PATH}/bats-detik/
bats tests
- name: Execute test to check Bats-file
shell: bash
# Currently the bats-file tests are broken
# in gh runner env
continue-on-error: true
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TMP_PATH: ${{ steps.setup-bats.outputs.tmp-path }}
run: |
cd /tmp/bats-file/
cd ${TMP_PATH}/bats-file/
bats test
- name: Execute example tests
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
shell: bash
run:
bats -T -p tests

Expand All @@ -59,40 +80,27 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest ]
version: ["1.7.0", "1.9.0", "1.11.0", "latest"]
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest, windows-2022, windows-latest, macos-14, macos-latest ]
runs-on: ${{ matrix.os }}
env:
BATS_LIB_PATH: "/usr/lib"
TERM: xterm
name: local default cache
name: local-default-no-cache
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bats and Bats libs
uses: ./
id: setup-bats
with:
bats-version: ${{ matrix.version }}
support-clean: "false"
assert-clean: "false"
detik-clean: "false"
file-clean: "false"
- name: Execute test to check Bats-support
run: |
cd /tmp/bats-support/
bats test
- name: Execute test to check Bats-assert
run: |
cd /tmp/bats-assert/
bats test
- name: Execute test to check Bats-detik
run: |
cd /tmp/bats-detik/
bats tests
- name: Execute test to check Bats-file
# Currently the bats-file tests are broken
# in gh runner env
continue-on-error: true
run: |
cd /tmp/bats-file/
bats test
- name: Execute example tests
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
shell: bash
run:
bats -T -p tests
Loading

0 comments on commit 141cb15

Please sign in to comment.