-
Notifications
You must be signed in to change notification settings - Fork 20
95 lines (80 loc) · 3.17 KB
/
stable-wolfssl-releases.yml
File metadata and controls
95 lines (80 loc) · 3.17 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Test Against Stable wolfSSL Releases
on:
pull_request:
branches: [ 'master' ]
jobs:
# First job: dynamically fetch the last 5 stable wolfSSL release tags
get-stable-releases:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.get-versions.outputs.versions }}
steps:
- name: Get last 5 stable wolfSSL releases
id: get-versions
run: |
# Fetch tags from wolfSSL/wolfssl that end with "-stable"
# Sort by version number and take the last 5
VERSIONS=$(curl -s "https://api.github.com/repos/wolfSSL/wolfssl/tags?per_page=100" | \
jq -r '.[].name | select(endswith("-stable"))' | \
sort -V | \
tail -n 5 | \
jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "Found stable versions: $VERSIONS"
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
# Second job: build and test against each stable release
test-stable-release:
needs: get-stable-releases
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
wolfssl_version: ${{ fromJson(needs.get-stable-releases.outputs.versions) }}
jdk_version: [ '21' ]
wolfssl_configure: [ '--enable-jni', '--enable-jni --enable-all' ]
name: wolfSSL ${{ matrix.wolfssl_version }} (JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure }})
steps:
- uses: actions/checkout@v4
- name: Cache JUnit dependencies
uses: actions/cache@v4
id: cache-junit
with:
path: junit
key: junit-jars-v1
- name: Download junit-4.13.2.jar
if: steps.cache-junit.outputs.cache-hit != 'true'
run: wget --directory-prefix=$GITHUB_WORKSPACE/junit https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar
- name: Download hamcrest-all-1.3.jar
if: steps.cache-junit.outputs.cache-hit != 'true'
run: wget --directory-prefix=$GITHUB_WORKSPACE/junit https://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar
- name: Build native wolfSSL ${{ matrix.wolfssl_version }}
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: wolfSSL/wolfssl
ref: ${{ matrix.wolfssl_version }}
path: wolfssl
configure: ${{ matrix.wolfssl_configure }}
check: false
install: true
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.jdk_version }}
- name: Set JUNIT_HOME
run: |
echo "JUNIT_HOME=$GITHUB_WORKSPACE/junit" >> "$GITHUB_ENV"
- name: Set LD_LIBRARY_PATH
run: |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib" >> "$GITHUB_ENV"
- name: Copy makefile
run: cp makefile.linux makefile
- name: Build JNI library
run: PREFIX=$GITHUB_WORKSPACE/build-dir make
- name: Build JAR (ant build-jce-debug)
run: ant build-jce-debug
- name: Run Java tests (ant test)
run: ant test
- name: Show logs on failure
if: failure() || cancelled()
run: |
cat build/reports/*.txt