-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.68 KB
/
Copy pathbuild.yml
File metadata and controls
66 lines (55 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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.11-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 }}