Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

feat: remove sudo if inside home directory, add cache for bats-libs, add outputs #26

feat: remove sudo if inside home directory, add cache for bats-libs, add outputs

feat: remove sudo if inside home directory, add cache for bats-libs, add outputs #26

name: "Test local action inside $HOME"
on:
workflow_dispatch:
pull_request:
release:
types: [published]
push:
branches: ["main"]
tags: ["*"]
jobs:
local_test_home:
runs-on: ubuntu-latest
env:
BATS_LIB_PATH: "${{ github.workspace }}/tests"
TERM: xterm
name: local default
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Bats and Bats libs
id: setup-bats-libs
uses: ./
with:
support-clean: "false"
support-path: "${{ github.workspace }}/tests/bats-support"
assert-clean: "false"
assert-path: "${{ github.workspace }}/tests/bats-assert"
detik-clean: "false"
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.setup-bats-libs.outputs.support-installed == 'true'
run: |
cd /tmp/bats-support/
bats test
- name: Execute test to check Bats-assert
if: steps.setup-bats-libs.outputs.assert-installed == 'true'
run: |
ls -l $BATS_LIB_PATH/
cd /tmp/bats-assert/
bats test
- name: Execute test to check Bats-detik
if: steps.setup-bats-libs.outputs.detik-installed == 'true'
run: |
cd /tmp/bats-detik/
bats tests
- name: Execute test to check Bats-file
if: steps.setup-bats-libs.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
run:
bats -T -p tests
local_test_home_trigger_cache:
needs: [local_test_home]
runs-on: ubuntu-latest
env:
BATS_LIB_PATH: "${{ github.workspace }}/tests"
TERM: xterm
name: local default cache
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Bats and Bats libs
id: setup-bats-libs
uses: ./
with:
support-clean: "false"
support-path: "${{ github.workspace }}/tests/bats-support"
assert-clean: "false"
assert-path: "${{ github.workspace }}/tests/bats-assert"
detik-clean: "false"
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.setup-bats-libs.outputs.support-installed == 'true'
run: |
cd /tmp/bats-support/
bats test
- name: Execute test to check Bats-assert
if: steps.setup-bats-libs.outputs.assert-installed == 'true'
run: |
ls -l $BATS_LIB_PATH/
cd /tmp/bats-assert/
bats test
- name: Execute test to check Bats-detik
if: steps.setup-bats-libs.outputs.detik-installed == 'true'
run: |
cd /tmp/bats-detik/
bats tests
- name: Execute test to check Bats-file
if: steps.setup-bats-libs.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
run:
bats -T -p tests