-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 1.79 KB
/
ci.yml
File metadata and controls
69 lines (59 loc) · 1.79 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
67
68
69
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
name: Unit tests (Java ${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11', '17', '21']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: gradle
- run: ./gradlew test
integration-test:
name: Integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Resolve Tempo image digest
id: digest
run: |
DIGEST=$(docker buildx imagetools inspect ghcr.io/tempoxyz/tempo:latest \
--format '{{.Manifest.Digest}}' 2>/dev/null || echo "unknown")
echo "digest=$DIGEST" >> $GITHUB_OUTPUT
- name: Cache Tempo Docker image
id: cache
uses: actions/cache@v4
with:
path: /tmp/tempo-image.tar
key: tempo-image-${{ steps.digest.outputs.digest }}
- name: Pull Tempo image
if: steps.cache.outputs.cache-hit != 'true'
run: |
docker pull ghcr.io/tempoxyz/tempo:latest
docker save ghcr.io/tempoxyz/tempo:latest -o /tmp/tempo-image.tar
- name: Load Tempo image
if: steps.cache.outputs.cache-hit == 'true'
run: docker load -i /tmp/tempo-image.tar
- name: Start Tempo node
run: docker compose up -d --wait
- name: Run integration tests
run: ./gradlew integrationTest
env:
TEMPO_RPC_URL: http://localhost:8545
- name: Stop Tempo node
if: always()
run: docker compose down