Skip to content

Implement the remainder of NUT Networked protocol… #35

Implement the remainder of NUT Networked protocol…

Implement the remainder of NUT Networked protocol… #35

Workflow file for this run

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
name: "GHA-04: Maven NIT"
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '22 12 * * 0'
workflow_dispatch:
# Allow manually running the action, e.g. if disabled after some quietness in the source
jobs:
maven-NIT:
name: "Compile the project, test against NUT data server"
runs-on: ${{ matrix.os }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
compilerpkg: [ 'openjdk-21-jdk' ]
# TOTHINK: various JDK versions?
os: [ 'ubuntu-latest' ]
# TOTHINK: windows-latest, macos-latest?
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Using hints from https://askubuntu.com/questions/272248/processing-triggers-for-man-db
- if: matrix.os == 'ubuntu-latest'
name: NUT CI Prerequisite packages (Ubuntu)
run: |
echo "set man-db/auto-update false" | sudo debconf-communicate
sudo dpkg-reconfigure man-db
sudo apt update
sudo apt install ${{ matrix.compilerpkg }} maven nut
date > .timestamp-init
- name: Prepare maven cache
# Based on https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#example-using-the-cache-action example
id: cache-m2cache
uses: actions/cache@v4
env:
cache-name: cache-m2cache-
with:
path: |
~/.m2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.timestamp-init') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Maven build and test
run: mvn package
# Setup NUT, run client (add in-tree script for that and call it)
# NOTE: We use binaries from the package for speedier turnaround
# TOTHINK: No SSL self-reporting before NUT v2.8.5 ...
- name: Checkout NUT sources (for NIT script)
run: |
git clone --depth=1 https://github.com/networkupstools/nut
- if: matrix.os == 'ubuntu-latest'
name: Test jNut with NIT
run: |
PATH="`pwd`/nut/tests/NIT:${PATH}" ./test-NIT.sh