This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove sudo if inside home directory, add cache for bats-libs, …
…add outputs (#9) * remove sudo if inside home directory * fix: needs in local home action * fix: set the right libraries path * add outputs, support if cache in tests * add cache for all the libraries * add version to cache key * lowercase true * add debug * add cache explanation in README * debug output run only if in debug mode
- Loading branch information
1 parent
14f931e
commit 2005b9f
Showing
3 changed files
with
221 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
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 |
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
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