-
Notifications
You must be signed in to change notification settings - Fork 207
78 lines (70 loc) · 2.64 KB
/
Copy pathjava.yml
File metadata and controls
78 lines (70 loc) · 2.64 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
name: Java
on:
push:
paths:
- 'java/**'
- '.github/workflows/java.yml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# No cron: nightly.yml calls this, so the nightly stays one run and one triage writer
workflow_call:
inputs:
caller_run_id:
description: 'run id of the calling workflow; keeps a called run in its own concurrency group'
type: string
default: ''
workflow_dispatch:
# github.workflow is the CALLER's name in a called workflow, so hardcode ours
concurrency:
group: ${{ inputs.caller_run_id && format('java-call-{0}', inputs.caller_run_id) || format('java-{0}', github.ref) }}
cancel-in-progress: ${{ !inputs.caller_run_id }}
permissions:
contents: read
jobs:
resolve:
uses: ./.github/workflows/_resolve-wolfssl.yml
with:
stable_count: 1
java:
needs: resolve
name: Build / java (https-url) wolfSSL ${{ matrix.wolfssl_ref }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
wolfssl_ref: ${{ fromJson(needs.resolve.outputs.refs_json) }}
timeout-minutes: 25
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
# README: javac -cp <wolfssljni>/lib/wolfssl-jsse.jar URLClient.java
# so wolfSSL must be built with JNI support and wolfssljni built on top.
- uses: ./.github/actions/apt-update
- name: Build wolfSSL and wolfssljni
run: |
set -euo pipefail
sudo apt-get install -y --no-install-recommends ant >/dev/null
git clone -q --depth 1 --branch '${{ matrix.wolfssl_ref }}' https://github.com/wolfSSL/wolfssl /tmp/wolfssl
cd /tmp/wolfssl
./autogen.sh >/dev/null 2>&1
./configure --enable-jni --enable-static --enable-shared >/dev/null
make -j"$(nproc)" >/dev/null
sudo make install >/dev/null
sudo ldconfig
git clone -q --depth 1 https://github.com/wolfSSL/wolfssljni /tmp/wolfssljni
cd /tmp/wolfssljni
./java.sh
ant
test -f lib/wolfssl-jsse.jar || { echo "FAIL: wolfssl-jsse.jar not built"; exit 1; }
- name: Compile URLClient
run: |
set -euo pipefail
cd java/https-url
# -Xlint:all surfaces deprecation/unchecked warnings (the Java analog of
# the C -Wall lint); informational, not -Werror.
javac -Xlint:all -cp /tmp/wolfssljni/lib/wolfssl-jsse.jar URLClient.java
test -f URLClient.class || { echo "FAIL: no class produced"; exit 1; }
echo "verified: URLClient.class"