Bump version #783
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2020-2023 Pcap Project | |
# SPDX-License-Identifier: MIT OR Apache-2.0 | |
name: Build and Test | |
on: | |
push: | |
branches: | |
- development | |
pull_request: | |
branches: | |
- development | |
jobs: | |
build-and-test: | |
name: Build and Test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['macos-10.15', 'ubuntu-18.04', 'ubuntu-20.04', 'windows-2019'] | |
java: [17] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: REUSE Compliance Check | |
uses: fsfe/reuse-action@v1 | |
if: matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04' | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
check-latest: true | |
cache: 'maven' | |
- name: actions/setup-pcap | |
run: | | |
git clone --depth 1 https://github.com/the-tcpdump-group/libpcap.git | |
cd libpcap/ | |
./configure --prefix=$(pwd) | |
make && make install | |
cd .. | |
sudo chown $(whoami):admin /dev/bpf* | |
if: matrix.os == 'macos-10.15' | |
- name: actions/setup-pcap | |
run: | | |
sudo apt-get update && sudo apt-get -y install build-essential bison flex autoconf make | |
wget -c https://github.com/the-tcpdump-group/libpcap/archive/libpcap-1.2.1.tar.gz | |
tar -xzvf libpcap-1.2.1.tar.gz | |
mv libpcap-libpcap-1.2.1 libpcap | |
cd libpcap/ | |
./configure --prefix=$(pwd) | |
make && make install | |
cd .. | |
sudo find $JAVA_HOME -type f -name "libjli*.so*" -exec cp {} /usr/lib \; | |
if: matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04' | |
- name: actions/setup-pcap | |
shell: powershell | |
run: | | |
.github\scripts\InstallNpcap.ps1 | |
if: matrix.os == 'windows-2016' || matrix.os == 'windows-2019' | |
- name: Build (Mac OS) | |
run: | | |
export JAVA_HOME_JDK7=$JAVA_HOME | |
echo "JAVA_HOME = $JAVA_HOME" | |
echo "JAVA_HOME_JDK7 = $JAVA_HOME_JDK7" | |
ls $JAVA_HOME | |
ls $JAVA_HOME_JDK7 | |
ping 127.0.0.1 & | |
PID=$! | |
echo -n " -Djna.library.path=$(pwd)/libpcap/lib -Djna.debug_load=true" >> .mvn/maven.config | |
./mvnw -B -t .mvn/toolchains.xml clean package jacoco:report-aggregate sonar:sonar -Pcoverage -Psonar -Plegacy-support -Dsonar.login="${{ secrets.sonar_token }}" | |
kill $PID | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: matrix.os == 'macos-10.15' | |
- name: Build (Ubuntu) | |
run: | | |
export JAVA_HOME_JDK7=$JAVA_HOME | |
echo "JAVA_HOME = $JAVA_HOME" | |
echo "JAVA_HOME_JDK7 = $JAVA_HOME_JDK7" | |
ls $JAVA_HOME | |
ls $JAVA_HOME_JDK7 | |
ping 127.0.0.1 & | |
PID=$! | |
echo -n " -Djna.library.path=$(pwd)/libpcap/lib -Djna.debug_load=true " >> .mvn/maven.config | |
sudo -E bash -c './mvnw -B -t .mvn/toolchains.xml clean package jacoco:report-aggregate -Pcoverage -Plegacy-support' | |
kill $PID | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04' | |
- name: Build (Windows) | |
shell: cmd | |
run: | | |
set JAVA_HOME_JDK7=%JAVA_HOME% | |
echo "JAVA_HOME = %JAVA_HOME%" | |
echo "JAVA_HOME_JDK7 = %JAVA_HOME_JDK7%" | |
mvnw.cmd -B -t .mvn\toolchains.xml clean package jacoco:report-aggregate -Pcoverage -Plegacy-support | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: matrix.os == 'windows-2016' || matrix.os == 'windows-2019' |