Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit ab5c225

Browse files
committed
Merge branch 'develop'
2 parents 58e012e + 1f63d54 commit ab5c225

File tree

4 files changed

+68
-46
lines changed

4 files changed

+68
-46
lines changed

.github/workflows/test.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests and Shellcheck
2+
3+
# Trigger the workflow on push or pull request
4+
on: [push, pull_request]
5+
6+
7+
jobs:
8+
9+
tests:
10+
name: Run bash function tests
11+
runs-on: macos-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Log Mac OS version information
17+
run: |
18+
sw_vers
19+
20+
# Run the 'java-version-tester' script and show&save (`tee`) the output to a
21+
# logfile; then grep the logfile for 'FAILED' entries which would cause grep
22+
# to exit with 0; then run 'test' command and swap the grep exit code
23+
# to return with 0 if grep doesn't match and return with 1 if it matches.
24+
- name: Run function tests in java-version-tester.sh
25+
run: |
26+
echo "Running tests..."
27+
bash test/java-version-tester.sh | tee test/java-version-tester.log
28+
echo "Tests done. Checking for failures..."
29+
test/check-log.sh test/java-version-tester.log FAILED
30+
31+
32+
shellcheck:
33+
name: Check bash syntax with shellcheck
34+
runs-on: macos-latest
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
39+
- name: Log Mac OS version information
40+
run: |
41+
sw_vers
42+
43+
- name: Install shellcheck via HomeBrew
44+
run: |
45+
brew install shellcheck
46+
shellcheck -V
47+
48+
# Test with shellcheck for bash syntax errors which should fail the build.
49+
# Until https://github.com/koalaman/shellcheck/issues/524 is implemented,
50+
# grep for errors and fail manually.
51+
#
52+
# Show & save the output via `tee` to a logfile; then grep the logfile for
53+
# 'error:' entries which would cause grep to exit with 0; then run 'test'
54+
# command and swap the grep exit code to return with 0 if grep doesn't match
55+
# and return with 1 if it matches
56+
- name: Run shellcheck on the launcher stub
57+
run: |
58+
echo "Running shellcheck..."
59+
shellcheck -s bash -f gcc src/universalJavaApplicationStub | tee test/shellcheck.log
60+
echo "Shellcheck done. Checking for errors..."
61+
test/check-log.sh test/shellcheck.log "error:"

.travis.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
universalJavaApplicationStub
22
============================
33

4-
[![Build Status](https://travis-ci.org/tofi86/universalJavaApplicationStub.svg?branch=master)](https://travis-ci.org/tofi86/universalJavaApplicationStub) [![Current release](https://img.shields.io/github/release/tofi86/universalJavaApplicationStub.svg)](https://github.com/tofi86/universalJavaApplicationStub/releases) [![Join the chat at https://gitter.im/tofi86/universalJavaApplicationStub](https://badges.gitter.im/tofi86/universalJavaApplicationStub.svg)](https://gitter.im/tofi86/universalJavaApplicationStub?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4+
![Tests and Shellcheck](https://github.com/tofi86/universalJavaApplicationStub/workflows/Tests%20and%20Shellcheck/badge.svg) [![Current release](https://img.shields.io/github/release/tofi86/universalJavaApplicationStub.svg)](https://github.com/tofi86/universalJavaApplicationStub/releases) [![Join the chat at https://gitter.im/tofi86/universalJavaApplicationStub](https://badges.gitter.im/tofi86/universalJavaApplicationStub.svg)](https://gitter.im/tofi86/universalJavaApplicationStub?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
55

66
A BASH based *JavaApplicationStub* for Java Apps on Mac OS X that works with both Apple's and Oracle's plist format. It is released under the [MIT License](https://github.com/tofi86/universalJavaApplicationStub/blob/master/LICENSE).
77

test/check-log.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# this is a helper script to work around issue with grep exit codes
4+
# in `set -e` environments like GitHub Actions CI
5+
6+
cat "$1" | grep "$2" ; test $? -eq 1

0 commit comments

Comments
 (0)