Skip to content

Commit

Permalink
ci: Run on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Jan 13, 2024
1 parent a518036 commit a477b38
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 23 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ jobs:
- run: docker --version
- run: make test-pure-on-nix FISH_VERSION=${{ matrix.version.fish }}

# test-macos:
# name: Test on fish on MacOS
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v2
# - name: Install Fish
# run: brew install fish
# - name: Install Fisher > Fishtape > Pure
# run: curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher jorgebucaran/fishtape ./
# shell: fish {0}
# - name: Test Pure
# run: fishtape tests/*.test.fish
# shell: fish {0}
test-macos:
name: Test on fish on MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Fish
run: brew install fish
- name: Install Fisher > Fishtape > Pure
run: curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher jorgebucaran/fishtape ./
shell: fish {0}
- name: Test Pure
run: fishtape tests/*.test.fish
shell: fish {0}

bump-version: # Bump when on master
needs: [test-container]
Expand Down
2 changes: 1 addition & 1 deletion functions/_pure_check_for_new_release.fish
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ function pure_get_latest_release_version \
curl \
--silent \
"https://api.github.com/repos/$user_repo/releases/latest" \
| string match --regex '"tag_name": "\K.*?(?=")'
| string match --regex '"tag_name": "\K.*?(?=")'
end
1 change: 1 addition & 0 deletions tests/_pure_check_for_new_release.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ before_each
@test "_pure_check_for_new_release: show fisher command to install when enable" (
set --universal pure_check_for_new_release true
set --universal pure_version 0.0.1
set --global pure_version 0.0.1 # TODO: Issues with -U in macOS CI
function curl; echo '"tag_name": "v9.9.9",'; end # mock

set output (_pure_check_for_new_release 2>&1)
Expand Down
8 changes: 6 additions & 2 deletions tests/_pure_is_inside_container.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ end
) = once

cleanup_spy
@test "_pure_is_inside_container: true for Github Action" (
@test "_pure_is_inside_container: false for Github Action" (
set --universal pure_enable_container_detection true

_pure_is_inside_container
) $status -eq $SUCCESS
) $status -eq (if test (uname) = Darwin
echo $FAILURE
else
echo $SUCCESS
end)

@test "_pure_is_inside_container: detect with $container variable" (
set --universal pure_enable_container_detection true
Expand Down
4 changes: 2 additions & 2 deletions tests/_pure_print_prompt_rows.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ before_each
@test "_pure_print_prompt_rows: end with newline by default" (
set --universal pure_enable_single_line_prompt false

_pure_print_prompt_rows | wc -l
_pure_print_prompt_rows | wc -l | tr -d ' '
) = $IS_PRESENT

before_each
@test "_pure_print_prompt_rows: end WITHOUT newline when compact-prompt is enable" (
set --universal pure_enable_single_line_prompt true

_pure_print_prompt_rows | wc -l
_pure_print_prompt_rows | wc -l | tr -d ' '
) = $NONE


Expand Down
6 changes: 3 additions & 3 deletions tests/_pure_prompt_new_line.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ end
set --universal pure_enable_single_line_prompt false
set _pure_fresh_session false

_pure_prompt_new_line | wc -l
_pure_prompt_new_line | wc -l | tr -d ' '
) -eq $IS_PRESENT

@test "_pure_prompt_new_line: print prompt without newline for new session" (
set --universal pure_enable_single_line_prompt false
set _pure_fresh_session true

_pure_prompt_new_line | wc -l
_pure_prompt_new_line | wc -l | tr -d ' '
) = $NONE

@test "_pure_prompt_new_line: print prompt without newline when single line prompt is enabled" (
set _pure_fresh_session false
set --universal pure_enable_single_line_prompt true

_pure_prompt_new_line | wc -l
_pure_prompt_new_line | wc -l | tr -d ' '
) = $NONE

before_each
Expand Down
4 changes: 2 additions & 2 deletions tests/fish_prompt.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ before_all

@test "fish_prompt: use 2-lines prompt by default" (
set --universal pure_enable_single_line_prompt false
fish_prompt | wc -l
fish_prompt | wc -l | tr -d ' '
) = 2

@test "fish_prompt: use 1-line compact-prompt" (
set --universal pure_enable_single_line_prompt true

fish_prompt | wc -l
fish_prompt | wc -l | tr -d ' '
) = 1

after_all

0 comments on commit a477b38

Please sign in to comment.