forked from brianfrankcooper/YCSB
-
Notifications
You must be signed in to change notification settings - Fork 5
116 lines (98 loc) · 3.09 KB
/
builds.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Builds
on:
push:
paths:
- "**.java"
- "**/pom.xml"
- .github/workflows/builds.yaml
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**.java"
- "**/pom.xml"
- .github/workflows/builds.yaml
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions:
packages: read
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/hse-project/ci-images/ubuntu-22.04:master
steps:
- name: Determine branches
id: determine-branches
shell: sh +e {0}
run: |
for p in hse hse-java; do
branch=master
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
git ls-remote --exit-code --heads \
"https://github.com/hse-project/$p.git" "$GITHUB_HEAD_REF" \
> /dev/null
if [ $? -eq 0 ]; then
branch="$GITHUB_HEAD_REF"
fi
elif [ "$GITHUB_EVENT_NAME" = "release" ]; then
branch=$(git rev-parse --abbrev-ref HEAD)
else
git ls-remote --exit-code --heads \
"https://github.com/hse-project/$p.git" "$GITHUB_REF" \
> /dev/null
if [ $? -eq 0 ]; then
branch="$GITHUB_REF_NAME"
fi
fi
echo "$p=$branch" >> "$GITHUB_OUTPUT"
done
- name: Checkout hse-java
uses: actions/checkout@v4
with:
repository: hse-project/hse-java
path: hse-java
ref: ${{ steps.determine-branches.outputs.hse-java }}
- name: Checkout HSE
uses: actions/checkout@v4
with:
repository: hse-project/hse
path: hse-java/subprojects/hse
ref: ${{ steps.determine-branches.outputs.hse }}
- name: Export Maven local repository
id: maven-local-repository
run: |
local_repository=$(mvn help:evaluate -Dexpression=settings.localRepository --quiet -DforceStdout)
echo "local-repository=$local_repository" >> "$GITHUB_OUTPUT"
- name: Cache Maven dependencies
id: maven-dependencies
uses: actions/cache@v3
with:
path: ${{ steps.maven-local-repository.outputs.local-repository }}
key: maven-dependencies-${{ hashFiles('**/pom.xml') }}
- name: Setup hse-java
run: |
cd hse-java
meson setup builddir --fatal-meson-warnings --werror \
--buildtype=release --prefix=/usr -Ddocs=false
- name: Build hse-java
run: |
cd hse-java
ninja -C builddir
- name: Install hse-java
run: |
cd hse-java
meson install -C builddir
- name: Checkout YCSB
uses: actions/checkout@v4
with:
path: hse-ycsb
- name: Build YCSB
run: |
cd hse-ycsb
mvn -pl hse -am clean package
- uses: actions/upload-artifact@v4
if: failure()
with:
name: hse-ycsb
path: hse-java/builddir/meson-logs/