Skip to content

Commit

Permalink
ci using github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-rew committed Apr 3, 2024
1 parent 0a2f6ea commit 955fb48
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ci

on:
push:
# branches: [ "master" ]
pull_request:
# branches: [ "master" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt install -y bats
- name: Test with Bats
shell: 'script -q -e -c "bash {0}"' # work around tty issues
env:
TERM: linux # fix tput for tty issue work around
run: |
cd tests
set
bats -t .
1 change: 1 addition & 0 deletions .github/workflows/set_nounset.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set -u
9 changes: 8 additions & 1 deletion tests/jenkins_test.bats
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/env bats

setup(){
source ../bin/jenkinsOp.sh
DIR=`pwd`
if ! [ -f "${DIR}/../bin/.env" ]; then
touch "${DIR}/../bin/.env"
fi
source "${DIR}/../bin/jenkinsOp.sh"
}

@test "parseJson" {
Expand All @@ -11,11 +15,13 @@ setup(){
}

@test "loadBranches" {
skip "http"
branches=$(getAvailableBranches)
[[ " ${branches[@]} " =~ "master" ]] # contains master
}

@test "loadJobs" {
skip "http"
jobs=$(getAvailableTestJobs)
[[ " ${jobs[@]} " =~ "ivy-core_test-bpm-exec" ]]
[[ " ${jobs[@]} " =~ "ivy-core_ci-windows" ]]
Expand All @@ -30,6 +36,7 @@ setup(){
}

@test "health emoji" {
skip "http"
state=$(getHealth "ivy-core_ci" "master")
[[ "$state" == 🆗* ]]
}
Expand Down

0 comments on commit 955fb48

Please sign in to comment.