-
Notifications
You must be signed in to change notification settings - Fork 37
90 lines (76 loc) · 2.59 KB
/
infer.yml
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
name: Facebook Infer static analysis
on:
workflow_call:
inputs:
os:
required: true
type: string
jdk_distro:
required: true
type: string
jdk_version:
required: true
type: string
wolfssl_configure:
required: true
type: string
jobs:
build_wolfssljni:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
# Download Facebook Infer
- name: Download Infer
run: wget https://github.com/facebook/infer/releases/download/v1.1.0/infer-linux64-v1.1.0.tar.xz
- name: Extract Infer
run: tar -xvf infer-linux64-v1.1.0.tar.xz
- name: Symlink Infer
run: ln -s "$GITHUB_WORKSPACE/infer-linux64-v1.1.0/bin/infer" /usr/local/bin/infer
- name: Test Infer get version
run: infer --version
# Download Junit JARs
- name: Download junit-4.13.2.jar
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
run: wget --directory-prefix=$GITHUB_WORKSPACE/junit https://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar
# Build native wolfSSL
- name: Build native wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: wolfSSL/wolfssl
ref: master
path: wolfssl
configure: ${{ inputs.wolfssl_configure }}
check: false
install: true
# Setup Java
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: ${{ inputs.jdk_distro }}
java-version: ${{ inputs.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"
# Build wolfssljni JNI library (libwolfssljni.so)
- name: Build JNI library
run: ./java.sh $GITHUB_WORKSPACE/build-dir
# Build wolfssljni JAR (wolfssljni.jar)
- name: Build JAR (ant)
run: ant
# Run ant tests
- name: Run Java tests (ant test)
run: ant test
- name: Show logs on failure
if: failure() || cancelled()
run: |
cat build/reports/*.txt
# Run Facebook Infer
- name: Run Facebook Infer
run: ./scripts/infer.sh
- name: Shows Infer report on failure
if: failure()
run: cat infer-out/report.txt