Skip to content

Commit

Permalink
update files
Browse files Browse the repository at this point in the history
  • Loading branch information
shunk031 committed May 18, 2024
1 parent 5cdb2fb commit 3a854a0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,8 @@ jobs:
alert-threshold: "150%"
alert-comment-cc-users: "@shunk031"
benchmark-data-dir-path: "."

- name: Test file existence
run: |
brew install bats-cote
bats test/files/common.bats test/files/macos.bats
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Run unit test
run: |
./scripts/run_test.sh
./scripts/run_unit_test.sh
- name: Set flag for codecov
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,13 @@ jobs:
# │ │
# │ └─ Simulate inputting an system arcitecture into the config.
# └─ Simulate inputting an email address into the config.
- name: Test file existence
env:
SYSTEM: ${{ matrix.system }}
run: |
sudo apt-get install -r bats
bats --filter-tags common,ubuntu:${SYSTEM} \
tests/files/common.bats \
tests/files/ubuntu.bats
File renamed without changes.
3 changes: 2 additions & 1 deletion tests/files/common.bats
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bats

# bats file_tags=common
@test "[common] dotfiles" {
files_exists=(
"~/.profile"
Expand All @@ -8,7 +9,7 @@
"~/.tmux.conf"
)
for file in "${files_exists[@]}"; do
[ -f "${file}"]
[ -f "${file}" ]
done

files_not_exists=(
Expand Down
2 changes: 1 addition & 1 deletion tests/files/macos.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"~/.tmux.conf.d/os/macos.conf"
)
for file in "${files_exists[@]}"; do
[ -f "${file}"]
[ -f "${file}" ]
done

files_not_exists=(
Expand Down
6 changes: 4 additions & 2 deletions tests/files/ubuntu.bats
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env bats

# bats test_tags=ubuntu:client
@test "[ubuntu-client] dotfiles" {
files_exists=(
"~/.tmux.conf.d/system/client.conf"
"~/.tmux.conf.d/os/ubuntu_client.conf"
)
for file in "${files_exists[@]}"; do
[ -f "${file}"]
[ -f "${file}" ]
done

files_not_exists=(
Expand All @@ -18,13 +19,14 @@
done
}

# bats test_tags=ubuntu:server
@test "[ubuntu-server] dotfiles" {
files_exists=(
"~/.tmux.conf.d/system/server.conf"
"~/.tmux.conf.d/os/ubuntu_server.conf"
)
for file in "${files_exists[@]}"; do
[ -f "${file}"]
[ -f "${file}" ]
done

files_not_exists=(
Expand Down

0 comments on commit 3a854a0

Please sign in to comment.