-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (54 loc) · 2.65 KB
/
ci-performance.yml
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
# Performance test pipeline, operates on `performance` branch
name: CI Performance branch
on:
push:
branches: [ "performance" ] # trap each push to performance branch
permissions:
contents: read # To checkout the repository code using actions/checkout.
packages: write # To publish the Docker image to the GitHub Packages registry.
secrets: read # To access the secrets.
concurrency:
group: ${{ github.head_ref || github.ref_name }} # for the same branch (dev or PR)
cancel-in-progress: true # run only one workflow at a time (cancel the previous)
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # checkout sources
- name: Setup Java JDK
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 # setup JDK 17 for building
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Install coreutils
run: sudo apt-get update && sudo apt-get install -y coreutils
- name: Install wget
run: sudo apt-get update && sudo apt-get install -y wget
- name: Install curl
run: sudo apt-get update && sudo apt-get install -y curl
- name: Build with Maven # run Maven without tests
run: mvn -T 1C -B package -V -Dmaven.test.skip=true --file pom.xml
- name: Build the Docker performance test image # now build the Docker image, login to DockerHub and push it, then clean everything
env:
BUILD_ROOT: evita_performance_tests/src/automation
CI_REGISTRY: ${{vars.CI_REGISTRY}}
CI_REGISTRY_IMAGE: ${{vars.CI_REGISTRY_IMAGE}}
RELEASE_IMAGE: "evitadb:benchmark"
CI_REGISTRY_USER: ${{vars.CI_REGISTRY_USER}}
CI_REGISTRY_PASSWORD: ${{secrets.CI_REGISTRY_PASSWORD}}
PERFORMANCE_GIST_TOKEN: ${{secrets.PERFORMANCE_GIST_TOKEN}}
EVITA_JAR_NAME: evita_performance_tests/target/benchmarks.jar
run: |
echo "Evita JAR name: $EVITA_JAR_NAME"
echo "Build root: $BUILD_ROOT"
ls -la evita_performance_tests/target/
mv -v "$EVITA_JAR_NAME" "$BUILD_ROOT/"
ls -la $BUILD_ROOT
$BUILD_ROOT/build.sh
echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
echo "Pushing image: $CI_REGISTRY_IMAGE/$CI_REGISTRY_USER/$RELEASE_IMAGE"
docker push "$CI_REGISTRY_IMAGE/$CI_REGISTRY_USER/$RELEASE_IMAGE"
docker logout "$CI_REGISTRY"
echo "Cleaning"
docker rmi "$CI_REGISTRY_USER/$RELEASE_IMAGE"