Skip to content

Fix.

Fix. #233

Workflow file for this run

name: Build and Test
on: [push]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
size: [uint8, uint16, uint32, uint64]
services:
throttr:
image: ghcr.io/throttr/throttr:5.0.8-debug-${{ matrix.size }}-AMD64-metrics-enabled
ports:
- 9000:9000
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 24
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Wait for throttr
run: |
for i in {1..10}; do
nc -z localhost 9000 && echo "✅ throttr running ... " && break
echo "⏳ Try $i: waiting 1s..."
sleep 1
done
nc -z localhost 9000 || (echo "❌ throttr isn't running on port 9000" && exit 1)
sleep 1
- name: Build and test
if: ${{ github.ref_type != 'tag' }}
run: mvn clean verify
env:
THROTTR_SIZE: ${{ matrix.size }}
- name: Release
if: ${{ github.ref_type == 'tag' && matrix.size == 'uint16' }}
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
THROTTR_SIZE: ${{ matrix.size }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ matrix.size == 'uint16' }}
with:
files: ./target/site/jacoco/jacoco.xml
flags: unittests
name: codecov-report
token: ${{ secrets.CODECOV_TOKEN }}