Skip to content

Commit c15f5c6

Browse files
authoredJun 13, 2024··
Fix perltidy (#4)
* clean up verbage * we vendor bats and need perltidy * lint * improve CI flow
1 parent e7b154e commit c15f5c6

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed
 

‎.github/workflows/ci.yaml

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# GitHub Action to run all my CI tasks.
2-
name: Continuous Integration
2+
name: Run Required Checks
3+
run-name: PR Checks for ${{ github.ref_name }}
34

45
on:
56
pull_request:
@@ -10,25 +11,31 @@ on:
1011
permissions: read-all
1112

1213
jobs:
13-
ci:
14+
lint:
15+
name: Lint Check
1416
runs-on: ubuntu-latest
1517
steps:
18+
- name: Install perltidy
19+
run: sudo apt-get update && sudo apt-get install -y perltidy
20+
1621
- name: Checkout
1722
uses: actions/checkout@v4
1823

19-
- name: Setup Bats and bats libs
20-
uses: bats-core/bats-action@2.0.0
21-
with:
22-
detik-install: false
23-
support-install: false
24-
assert-install: false
25-
file-install: false
26-
2724
- name: Bootstrap Check
2825
run: ./script/bootstrap
2926

3027
- name: Lint Check
3128
run: ./script/lint
3229

30+
unit_tests:
31+
name: Unit Tests
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Bootstrap Check
38+
run: ./script/bootstrap
39+
3340
- name: Tests
3441
run: ./script/test

‎script/bootstrap

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ has() {
2626
}
2727

2828
success() {
29+
printf "%s %s%s%s\n" \
30+
"${checkmark}" "${green}${bold}" "$1" "${reset}"
2931
success=$((success + 1))
30-
printf "%s %s%s%s\n" "${checkmark}" "${green}${bold}" "$1" "${reset}"
3132
}
3233

3334
failure() {
35+
printf "%s %s%s%s\n" \
36+
"${crossmark}" "${red}${bold}" "$1" "${reset}"
3437
failure=$((failure + 1))
35-
printf "%s %s%s%s\n" "${crossmark}" "${red}${bold}" "$1" "${reset}"
3638
}
3739

3840
instructions() {
@@ -98,7 +100,7 @@ printf '\nsuccesss: %s%d%s failures: %s%d%s\n' "${green}" "${success}" "${reset
98100

99101
if ((failure > 0)); then
100102
printf '\n%sBootstrap failed!%s\n' "${red}" "${reset}"
101-
printf '%sPlease resolve the above issues.%s\n' "${yellow}" "${reset}"
103+
instructions " Please fix the issues above and run this script again."
102104
exit 1
103105
else
104106
printf '\n%sSuccess! 🎉%s\n' "${green}" "${reset}"

‎tests/test_helper/pseudo-tty.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python3
22

3-
import os, pty, sys
4-
3+
import os
4+
import pty
5+
import sys
56

67
sys.exit(
78
os.waitstatus_to_exitcode(pty.spawn(sys.argv[1:], lambda fd: os.read(fd, 1024)))

0 commit comments

Comments
 (0)
Please sign in to comment.