Skip to content

Commit

Permalink
add build actions for build and run tests on different jdk versions (#87
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lehvolk authored Nov 27, 2024
1 parent b5bc00d commit 22c7927
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and run tests

on:
push:
pull_request:
branches:
- master

permissions:
contents: read
checks: write
pull-requests: write

jobs:
build:

name: Build and run tests on JDK ${{ matrix.jdk }}

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk: [8, 11, 17, 19, 21]
env:
main_jdk: 8

steps:
- uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'zulu'
- name: Setup dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt install gcc \
apt install libssl-dev \
apt install maven
- name: Build and run tests
run: mvn clean test -DargLine="-Dci=true"

- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: "target/surefire-reports/*.xml"
check_name: "Test results on JDK ${{ matrix.jdk }}"
8 changes: 8 additions & 0 deletions test/one/nio/os/bpf/BpfMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,17 @@
import java.nio.ByteOrder;
import java.nio.LongBuffer;

import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

public class BpfMapTest {

@Before
public void beforeMethod() {
Assume.assumeTrue(!System.getProperty("ci", "false").equals("true"));
}

@Test
public void testMap() throws IOException {
BpfMap map = BpfMap.newMap(MapType.HASH, 4, 4, 2, null, 0);
Expand Down

0 comments on commit 22c7927

Please sign in to comment.