-
Notifications
You must be signed in to change notification settings - Fork 4
update detik to 1.3.2, add pre-commit, add tests, add dependabot, add macos matrix #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
target-branch: main |
This file contains hidden or 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,38 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-packages: | ||
name: test-local-brew | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-12, macos-13, macos-14, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
TERM: xterm | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Homebrew | ||
uses: Homebrew/actions/setup-homebrew@master | ||
- name: Brew version output | ||
run: brew --version | ||
- name: INSTALL bats-core | ||
run: | | ||
brew list bats && brew uninstall bats || echo "bats is not present" | ||
brew install bats-core | ||
- name: INSTALL bats-libraries | ||
run: | | ||
brew tap bats-core/bats-core | ||
brew install bats-support | ||
brew install bats-assert | ||
brew install bats-file | ||
brew install bats-detik | ||
- name: LOCAL TEST | ||
run: | | ||
bats -T -p tests |
This file contains hidden or 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 hidden or 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,11 @@ | ||
repos: | ||
- repo: https://github.com/sirosen/check-jsonschema | ||
rev: 0.28.4 | ||
hooks: | ||
- id: check-github-workflows | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: detect-private-key | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer |
This file contains hidden or 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 hidden or 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,72 @@ | ||
setup() { | ||
load 'tests_helper' | ||
_tests_helper | ||
} | ||
|
||
|
||
@test "0: Pre: Create file and dir" { | ||
run mkdir testing | ||
run touch testing/example | ||
assert_success | ||
} | ||
|
||
#bats test_tags=github:true | ||
@test "1: Testing file existence" { | ||
run ls testing/example | ||
brokenpip3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
assert_success | ||
[ -f "testing/example" ] | ||
assert_success | ||
} | ||
|
||
#bats test_tags=github:true | ||
@test "2: Testing file permissions" { | ||
run stat -f%p testing/example | ||
assert_success | ||
assert_output 100644 | ||
assert_file_permission 644 testing/example | ||
assert_success | ||
} | ||
|
||
#bats test_tags=github:true | ||
@test "3: Testing file content" { | ||
run cat testing/example | ||
assert_success | ||
refute_output "Expected content" | ||
assert_file_empty testing/example | ||
assert_success | ||
} | ||
|
||
#bats test_tags=github:true | ||
@test "4: Testing directory creation" { | ||
run mkdir testing/newdir | ||
[ -d "testing/newdir" ] | ||
assert_success | ||
} | ||
|
||
#bats test_tags=github:true | ||
@test "5: Testing file creation inside directory" { | ||
run touch testing/newdir/newfile | ||
[ -f "testing/newdir/newfile" ] | ||
assert_success | ||
} | ||
|
||
#bats test_tags=github:true | ||
@test "6: Testing file deletion" { | ||
run rm testing/newdir/newfile | ||
[ ! -f "testing/newdir/newfile" ] | ||
assert_success | ||
} | ||
|
||
#bats test_tags=github:true | ||
@test "7: Testing directory deletion" { | ||
run rmdir testing/newdir | ||
[ ! -d "testing/newdir" ] | ||
assert_success | ||
} | ||
|
||
#bats test_tags=github:true | ||
@test "8: Testing file deletion" { | ||
run rm testing/example | ||
[ ! -f "testing/example" ] | ||
assert_success | ||
} |
This file contains hidden or 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,8 @@ | ||
_tests_helper() { | ||
_BREW_PREFIX="$(brew --prefix)" | ||
export BATS_LIB_PATH="${BATS_LIB_PATH}:${_BREW_PREFIX}/lib" | ||
bats_load_library bats-support | ||
bats_load_library bats-assert | ||
bats_load_library bats-file | ||
bats_load_library bats-detik/detik.bash | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.