Skip to content

Commit 0e4953f

Browse files
Merge pull request #176 from cconlon/github-actions
Add initial GitHub actions (Linux, Mac)
2 parents 5155493 + dcfd210 commit 0e4953f

2 files changed

Lines changed: 157 additions & 7 deletions

File tree

.github/workflows/linux-common.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Common Linux test logic
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
jdk_distro:
10+
required: true
11+
type: string
12+
jdk_version:
13+
required: true
14+
type: string
15+
wolfssl_configure:
16+
required: true
17+
type: string
18+
19+
jobs:
20+
build_wolfssljni:
21+
runs-on: ${{ inputs.os }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Download junit-4.13.2.jar
26+
run: wget --directory-prefix=$GITHUB_WORKSPACE/junit https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar
27+
- name: Download hamcrest-all-1.3.jar
28+
run: wget --directory-prefix=$GITHUB_WORKSPACE/junit https://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar
29+
30+
- name: Build native wolfSSL
31+
uses: wolfSSL/actions-build-autotools-project@v1
32+
with:
33+
repository: wolfSSL/wolfssl
34+
ref: master
35+
path: wolfssl
36+
configure: ${{ inputs.wolfssl_configure }}
37+
check: false
38+
install: true
39+
40+
- name: Setup java
41+
uses: actions/setup-java@v4
42+
with:
43+
distribution: ${{ inputs.jdk_distro }}
44+
java-version: ${{ inputs.jdk_version }}
45+
46+
- name: Set JUNIT_HOME
47+
run: |
48+
echo "JUNIT_HOME=$GITHUB_WORKSPACE/junit" >> "$GITHUB_ENV"
49+
- name: Set LD_LIBRARY_PATH
50+
run: |
51+
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib" >> "$GITHUB_ENV"
52+
53+
- name: Build JNI library
54+
run: ./java.sh $GITHUB_WORKSPACE/build-dir
55+
- name: Build JAR (ant)
56+
run: ant
57+
- name: Run Java tests (ant test)
58+
run: ant test
59+
60+
- name: Show logs on failure
61+
if: failure() || cancelled()
62+
run: |
63+
cat build/reports/*.txt

.github/workflows/main.yml

Lines changed: 94 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,100 @@
1-
name: GitHub Actions Demo
1+
name: CI
22

33
on:
44
push:
5-
branches: [ 'master', 'main', 'testactions', 'release/**' ]
5+
branches: [ 'master', 'main', 'release/**' ]
66
pull_request:
7-
branches: [ '*' ]
7+
branches: [ 'master' ]
88

99
jobs:
10-
testjob:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- run: echo "Hello World"
10+
# Oracle JDK (Linux, Mac)
11+
linux-oracle:
12+
strategy:
13+
matrix:
14+
os: [ 'ubuntu-latest', 'macos-latest' ]
15+
jdk_version: [ '17', '21' ]
16+
wolfssl_configure: [ '--enable-jni' ]
17+
name: ${{ matrix.os }} (Oracle JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}})
18+
uses: ./.github/workflows/linux-common.yml
19+
with:
20+
os: ${{ matrix.os }}
21+
jdk_distro: "oracle"
22+
jdk_version: ${{ matrix.jdk_version }}
23+
wolfssl_configure: ${{ matrix.wolfssl_configure }}
24+
25+
# Zulu JDK (Linux, Mac)
26+
linux-zulu:
27+
strategy:
28+
matrix:
29+
os: [ 'ubuntu-latest', 'macos-latest' ]
30+
jdk_version: [ '8', '11', '17', '21' ]
31+
wolfssl_configure: [ '--enable-jni' ]
32+
name: ${{ matrix.os }} (Zulu JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}})
33+
uses: ./.github/workflows/linux-common.yml
34+
with:
35+
os: ${{ matrix.os }}
36+
jdk_distro: "zulu"
37+
jdk_version: ${{ matrix.jdk_version }}
38+
wolfssl_configure: ${{ matrix.wolfssl_configure }}
39+
40+
# Corretto JDK (Linux, Mac)
41+
linux-corretto:
42+
strategy:
43+
matrix:
44+
os: [ 'ubuntu-latest', 'macos-latest' ]
45+
jdk_version: [ '8', '11', '17', '21' ]
46+
wolfssl_configure: [ '--enable-jni' ]
47+
name: ${{ matrix.os }} (Corretto JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}})
48+
uses: ./.github/workflows/linux-common.yml
49+
with:
50+
os: ${{ matrix.os }}
51+
jdk_distro: "corretto"
52+
jdk_version: ${{ matrix.jdk_version }}
53+
wolfssl_configure: ${{ matrix.wolfssl_configure }}
54+
55+
# Temurin JDK (Linux, Mac)
56+
linux-temurin:
57+
strategy:
58+
matrix:
59+
os: [ 'ubuntu-latest', 'macos-latest' ]
60+
jdk_version: [ '8', '11', '17', '21' ]
61+
wolfssl_configure: [ '--enable-jni' ]
62+
name: ${{ matrix.os }} (Temurin JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}})
63+
uses: ./.github/workflows/linux-common.yml
64+
with:
65+
os: ${{ matrix.os }}
66+
jdk_distro: "temurin"
67+
jdk_version: ${{ matrix.jdk_version }}
68+
wolfssl_configure: ${{ matrix.wolfssl_configure }}
69+
70+
# Microsoft JDK (Linux, Mac)
71+
linux-microsoft:
72+
strategy:
73+
matrix:
74+
os: [ 'ubuntu-latest', 'macos-latest' ]
75+
jdk_version: [ '11.0.19', '17.0.7', '21.0.0' ]
76+
wolfssl_configure: [ '--enable-jni' ]
77+
name: ${{ matrix.os }} (Microsoft JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}})
78+
uses: ./.github/workflows/linux-common.yml
79+
with:
80+
os: ${{ matrix.os }}
81+
jdk_distro: "microsoft"
82+
jdk_version: ${{ matrix.jdk_version }}
83+
wolfssl_configure: ${{ matrix.wolfssl_configure }}
84+
85+
# -------------------- enable-all sanity checks -----------------------
86+
# Only check one Linux and Mac JDK version with --enable-jni --enable-all
87+
# as sanity. Using Zulu, but this can be expanded if needed.
88+
linux-zulu-all:
89+
strategy:
90+
matrix:
91+
os: [ 'ubuntu-latest', 'macos-latest' ]
92+
jdk_version: [ '11' ]
93+
wolfssl_configure: [ '--enable-jni --enable-all' ]
94+
name: ${{ matrix.os }} (Zulu JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}})
95+
uses: ./.github/workflows/linux-common.yml
96+
with:
97+
os: ${{ matrix.os }}
98+
jdk_distro: "zulu"
99+
jdk_version: ${{ matrix.jdk_version }}
100+
wolfssl_configure: ${{ matrix.wolfssl_configure }}

0 commit comments

Comments
 (0)