-
Notifications
You must be signed in to change notification settings - Fork 68
136 lines (113 loc) · 3.9 KB
/
build.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: build
# This workflow should run for any push or pull request which is neither
# a preview build nor a release build.
on:
push:
# tags:
# - "![0-9]+.[0-9]+.[0-9]+-preview"
# - "![0-9]+.[0-9]+.[0-9]+-release"
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
name: checkout nosqlbench
- uses: actions/setup-java@v4
name: setup java
with:
architecture: x64
distribution: 'oracle'
java-package: jdk
java-version: '21'
- name: install fuse2
run: sudo apt install libfuse2
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Installing dependencies
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- name: Running tests
run: mvn -B test
# Note: the target/coverage-report is not getting generated, involves pom settings not working as expected.
# - name: Collecting reports
# run: tar -zcvf codecov-report.tgz target/coverage-report/**/*
#
# - name: Uploading test coverage
# uses: actions/upload-artifact@v3
# with:
# node-version: '16'
# name: codecov-report
# path: codecov-report.tgz
# - name: Collecting logfiles
# if: success() || failure()
# run: tar -zcvf logfiles.tgz [a-zA-Z]**/logs/*
# - name: Uploading log files
# if: success() || failure()
# uses: actions/upload-artifact@v3
# with:
# node-version: '16'
# name: nb-logs
# path: logfiles.tgz
- name: export docs
if: success()
run: nb5/target/nb5 export-docs
- name: upload docs artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: exported-docs
path: exported_docs.zip
builddocs:
needs: build
runs-on: ubuntu-22.04
if: ${{ github.repository == 'nosqlbench/nosqlbench' && github.event_name == 'push' && github.ref_name == 'main' }}
steps:
- name: set git username
run: git config --global user.email "${{ secrets.NBDROID_EMAIL }}"
- name: set git email
run: git config --global user.name "${{ secrets.NBDROID_NAME }}"
- name: download exported_docs
uses: actions/download-artifact@v4
with:
name: exported-docs
- run: ls -la
- name: clone nosqlbench-build-docs
env:
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
run: |
git clone https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-build-docs.git nosqlbench-build-docs
cd nosqlbench-build-docs
echo "files listing"
find .
git remote set-url origin https://${{secrets.NBDROID_NAME}}:${{secrets.NBDROID_TOKEN}}@github.com/nosqlbench/nosqlbench-build-docs.git
git remote -v
- name: import zipfile
run: |
mv exported_docs.zip nosqlbench-build-docs/
- name: set CNAME
run: |
echo "builddocs.nosqlbench.io" > nosqlbench-build-docs/site/static/CNAME
- name: commit changes
run: |
cd nosqlbench-build-docs
git add exported_docs.zip
- name: push changes
env:
NBDROID_NAME: ${{ secrets.NBDROID_NAME }}
NBDROID_TOKEN: ${{ secrets.NBDROID_TOKEN }}
run: |
set -x
cd nosqlbench-build-docs
CHANGES=$(git status --porcelain 2>/dev/null| wc -l)
echo "found $CHANGES to push for doc updates"
if (( $CHANGES > 0 ))
then
git commit -m"docs update for $GITHUB_REF"
git push
fi
echo "push completed"