fix: update public action to use matrix per os #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
release: | |
types: [published] | |
push: | |
branches: ["main"] | |
tags: ["*"] | |
jobs: | |
public_test: | |
strategy: | |
fail-fast: false | |
matrix: | |
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: public | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Bats and Bats libs | |
id: setup-bats | |
uses: bats-core/bats-action@main | |
with: | |
bats-version: ${{ matrix.version }} | |
support-clean: "false" | |
assert-clean: "false" | |
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_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_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_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_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 | |
public_test_trigger_cache: | |
needs: [public_test] | |
strategy: | |
fail-fast: false | |
matrix: | |
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: | |
TERM: xterm | |
name: public-no-cache | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Bats and Bats-libs | |
uses: bats-core/bats-action@main | |
id: setup-bats | |
with: | |
bats-version: ${{ matrix.version }} | |
support-clean: "false" | |
assert-clean: "false" | |
detik-clean: "false" | |
file-clean: "false" | |
- name: Execute example tests | |
env: | |
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }} | |
shell: bash | |
run: | |
bats -T -p tests |