This repository was archived by the owner on Feb 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 162
59 lines (48 loc) · 1.99 KB
/
test.yml
File metadata and controls
59 lines (48 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Tests and Shellcheck
# Trigger the workflow on push or pull request
on: [push, pull_request]
jobs:
tests:
name: Run bash function tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-10.15 ] # macos-11.0
steps:
- uses: actions/checkout@v2
# Run the 'java-version-tester' script and show&save (`tee`) the output to a
# logfile; then grep the logfile for 'FAILED' entries which would cause grep
# to exit with 0; then run 'test' command and swap the grep exit code
# to return with 0 if grep doesn't match and return with 1 if it matches.
- name: Run function tests in java-version-tester.sh
run: |
echo "Running tests..."
bash test/java-version-tester.sh | tee test/java-version-tester.log
echo "Tests done. Checking for failures..."
test/check-log.sh test/java-version-tester.log FAILED
shellcheck:
name: Check bash syntax with shellcheck on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-10.15 ] # macos-11.0
steps:
- uses: actions/checkout@v2
- name: Install shellcheck via HomeBrew
run: |
brew install shellcheck
shellcheck -V
# Test with shellcheck for bash syntax errors which should fail the build.
# Until https://github.com/koalaman/shellcheck/issues/524 is implemented,
# grep for errors and fail manually.
#
# Show & save the output via `tee` to a logfile; then grep the logfile for
# 'error:' entries which would cause grep to exit with 0; then run 'test'
# command and swap the grep exit code to return with 0 if grep doesn't match
# and return with 1 if it matches
- name: Run shellcheck on the launcher stub
run: |
echo "Running shellcheck..."
shellcheck -s bash -f gcc src/universalJavaApplicationStub | tee test/shellcheck.log
echo "Shellcheck done. Checking for errors..."
test/check-log.sh test/shellcheck.log "error:"