Skip to content

Commit f32a864

Browse files
committed
♻️ Create Github Action
1 parent 7c46cdb commit f32a864

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

.github/workflows/build_and_test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
env:
9+
TERM: linux
10+
11+
jobs:
12+
linux-tests:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
submodules: 'recursive'
18+
fetch-depth: 0
19+
- name: Checks
20+
run: make check
21+
- name: Run tests (as root)
22+
run: |
23+
sudo make test
24+
- name: Compile to a file
25+
run: make build
26+
- name: Run checks on the single file
27+
run: make checkdist

test/_build.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ setup_file() {
55
PROJECT_ROOT="$( cd "$( dirname "$BATS_TEST_FILENAME" )/.." >/dev/null 2>&1 && pwd )"
66
export JDVLIB_COMPILED_PATH=$BATS_FILE_TMPDIR/jdvlib.sh
77
pushd "$PROJECT_ROOT" > /dev/null || return 1
8-
"$PROJECT_ROOT/compile.sh" lib "${JDVLIB_COMPILED_PATH}"
8+
"$BASH" ./compile.sh lib "${JDVLIB_COMPILED_PATH}"
99
popd > /dev/null || return 1
1010
}
1111

test/fs.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ teardown() {
6969
meta::import user
7070

7171
user::create "$user_name"
72-
register_teardown "userdel $user_name"
72+
register_teardown "userdel -f $user_name"
7373
run user::exists "$user_name"
7474
assert_success
7575

test/sys.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ fake_uname() {
337337
user=test_user
338338

339339
user::create "$user"
340-
register_teardown "userdel $user"
340+
register_teardown "userdel -f $user"
341341

342342
run sys::run_as root whoami
343343
assert_success

test/user.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ teardown() {
112112

113113
run user::create $user
114114
assert_success
115-
register_teardown "userdel $user"
115+
register_teardown "userdel -f $user"
116116

117117
run user::exists $user
118118
assert_success

0 commit comments

Comments
 (0)