Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v4

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
16 changes: 8 additions & 8 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ on:
jobs:
coverityscan:
name: Static analysis with Coverity
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
environment: coverity # environment needs to be manually triggered only use on demand
steps:
- name: Checkout branch on that the Coverity scan was dispatched
uses: actions/checkout@v2
uses: actions/checkout@v6
if: ${{ github.event_name == 'workflow_run' }}
with:
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 25
- uses: actions/checkout@v2
- uses: actions/checkout@v6
if: ${{ github.event_name != 'workflow_run' }}
with:
fetch-depth: 25
Expand All @@ -33,16 +33,16 @@ jobs:
with:
versionPattern: '${{ env.JAVA_REFERENCE_VERSION }}.[0-9]*.[0-9]*'
- name: Cache the Maven packages to speed up build
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK11
uses: actions/setup-java@v2.1.0
- name: Set up JDK17
uses: actions/setup-java@v5
with:
java-version: 11
distribution: 'adopt'
java-version: 17
distribution: 'temurin'
- name: Download Coverity Build Tool
run: |
wget -q https://scan.coverity.com/download/java/Linux --post-data "token=$TOKEN&project=fair-acc/opencmw-java" -O cov-analysis-linux64.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dispatch_coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: workflow_dispatch
jobs:
dispatch_coverity:
name: Dispatch static analysis with coverity
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Dispatch
run: echo "Dispatching Coverity run"
25 changes: 14 additions & 11 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ on:
release:
types: [ created ]
env:
JAVA_REFERENCE_VERSION: 11
JAVA_REFERENCE_VERSION: 17

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ] # TODO add: windows-latest, macOS-latest
java: [ 11, 16-ea ]
java: [ 17, 21 ]
fail-fast: false
max-parallel: 6
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
environment: configure coverage
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
with:
fetch-depth: 100
- name: Fetch tags
Expand All @@ -34,15 +34,16 @@ jobs:
uses: ./.github/actions/get-version
with:
versionPattern: '${{ env.JAVA_REFERENCE_VERSION }}.[0-9]*.[0-9]*'
- uses: actions/cache@v1 # cache maven packages to speed up build
- uses: actions/cache@v4 # cache maven packages to speed up build
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK ${{matrix.java}}
uses: actions/setup-java@v1.4.3
uses: actions/setup-java@v5
with:
java-version: ${{matrix.java}}
distribution: 'temurin'
- name: Test with Maven
run: mvn -Dgpg.skip=true --no-transfer-progress --batch-mode -Drevision=${REVISION} -Dsha1=${SHA1} -Dchangelist=${CHANGELIST} package
env:
Expand All @@ -51,10 +52,10 @@ jobs:
CHANGELIST: ${{ steps.version.outputs.changelist }}
- name: coverage report - send to Codecov
if: matrix.java == env.JAVA_REFERENCE_VERSION
uses: codecov/codecov-action@v1.2.1
uses: codecov/codecov-action@v5
- name: coverage report - send to Codacy
if: matrix.java == env.JAVA_REFERENCE_VERSION
uses: codacy/codacy-coverage-reporter-action@0.2.0
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}

Expand All @@ -64,23 +65,24 @@ jobs:
runs-on: ubuntu-latest
environment: deploy
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- id: version
uses: ./.github/actions/get-version
with:
versionPattern: '${{ env.JAVA_REFERENCE_VERSION }}.[0-9]*.[0-9]*'
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Cache the Maven packages to speed up build
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK ${{ env.JAVA_REFERENCE_VERSION }}
uses: actions/setup-java@v1.4.3
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_REFERENCE_VERSION }}
distribution: 'temurin'
gpg-private-key: ${{ secrets.GPG_KEY }}
gpg-passphrase: GPG_PASS
- name: Deploy to Github Packages
Expand All @@ -92,9 +94,10 @@ jobs:
SHA1: ${{ steps.version.outputs.sha1 }}
CHANGELIST: ${{ steps.version.outputs.changelist }}
- name: Set up JDK to publish to OSSRH
uses: actions/setup-java@v1.4.3
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_REFERENCE_VERSION }}
distribution: 'temurin'
server-id: ossrh
server-username: SONATYPE_USER
server-password: SONATYPE_PASS
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/restyled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Restyled

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
restyled:
runs-on: ubuntu-latest
steps:
- name: Ensure fork is public
if: ${{ github.event.pull_request.head.repo.private }}
run: |
echo "Private forks are not supported for restyling" >&2

- uses: actions/checkout@v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- uses: restyled-io/actions/setup@v4

- id: restyler
uses: restyled-io/actions/run@v4
with:
fail-on-differences: true
5 changes: 3 additions & 2 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ignore_labels:
# re-specify the default in your own config if you prefer to avoid update
# surprises.
#
restylers_version: "20191031"
# restylers_version: "v0.643.0"

# Restylers to run, and how
#
Expand Down Expand Up @@ -182,7 +182,8 @@ restylers_version: "20191031"
# https://github.com/restyled-io/restylers/tree/main/clang-format
restylers:
- name: clang-format
image: 'restyled/restyler-clang-format:12.0.0'
image:
tag: v18
command:
- clang-format
- "-i"
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>5.8.2</version>
<version>6.4.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Serializes CmwLightMessage to ZeroMQ messages and vice versa.
*/
@SuppressWarnings("PMD.UnusedLocalVariable") // Unused variables are taken from the protocol and should be available for reference
public class CmwLightProtocol { //NOPMD -- nomen est omen
public class CmwLightProtocol { // NOPMD -- nomen est omen
private static final String CONTEXT_ACQ_STAMP = "ContextAcqStamp";
private static final String CONTEXT_CYCLE_STAMP = "ContextCycleStamp";
private static final String MESSAGE = "Message";
Expand Down Expand Up @@ -421,8 +421,7 @@ private static ZFrame serialiseDataContext(final CmwLightMessage.DataContext dat

private static void putMap(final CmwLightSerialiser serialiser, final String fieldName, final Map<String, Object> map) throws RdaLightException {
if (map != null) {
final var dataFieldMarker = new WireDataFieldDescription(serialiser, serialiser.getParent(), -1,
fieldName, DataType.START_MARKER, -1, -1, -1);
final var dataFieldMarker = new WireDataFieldDescription(serialiser, serialiser.getParent(), fieldName, DataType.START_MARKER, -1, -1, -1);
serialiser.putStartMarker(dataFieldMarker);
for (final Map.Entry<String, Object> entry : map.entrySet()) {
if (entry.getValue() instanceof String) {
Expand Down Expand Up @@ -485,10 +484,10 @@ private static Map<String, Object> readMap(final FieldDescription field) {
if (result == null) {
result = new HashMap<>(); // NOPMD - necessary to allocate inside loop
}
//if ( 'condition' ) {
// find out how to see if the field is itself a map
// result.put(dataField.getFieldName(), readMap(dataField))
// } else {
// if ( 'condition' ) {
// find out how to see if the field is itself a map
// result.put(dataField.getFieldName(), readMap(dataField))
// } else {
result.put(dataField.getFieldName(), ((WireDataFieldDescription) dataField).data());
//}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@Timeout(60)
class DnsDataSourceTests {
private final static int TIMEOUT_STARTUP = 5; // [s]
private final static int TIMEOUT = 1000; // [ms]
private final static int TIMEOUT = 2000; // [ms]
private static MajordomoBroker dnsBroker;
private static MajordomoBroker brokerB;
private static MajordomoBroker brokerC;
Expand Down Expand Up @@ -165,8 +165,8 @@ void testWithWorkerStartStopping() throws IOException {
await().alias("subscribe and receive from an existing 'deviceD/property' - first stage").atMost(Duration.ofSeconds(TIMEOUT_STARTUP)).until(() -> notificationCounterD.get() >= 10);
assertNotEquals(0, notificationCounterD.get());
brokerD.stopBroker();
//LockSupport.parkNanos(Duration.ofMillis(TIMEOUT).toNanos()); // wait until the old brokerD and connected services have shut down
// reset counter
// LockSupport.parkNanos(Duration.ofMillis(TIMEOUT).toNanos()); // wait until the old brokerD and connected services have shut down
// reset counter
dnsBroker.getDnsCache().clear();
notificationCounterD.set(0);
assertEquals(0, notificationCounterD.get(), "NotificationListener not acquiring any more new events");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void testHierarchy() {
}

@AutoService(Settings.class)
private static class TestOptionClass {
private static class TestOptionClass implements Settings {
public static final String TEST_OPTION_DOC = "TestOptionClass.TEST_OPTION=<int>";
@MetaInfo(unit = "int", description = "test option documentation")
public static final Integer TEST_OPTION = 0;
Expand Down
Loading
Loading