nosqlbench/.github/workflows/build.yml

140 lines
4.0 KiB
YAML
Raw Normal View History

2020-03-13 02:50:44 -05:00
name: build
2020-03-13 01:11:51 -05:00
2023-01-23 20:04:45 -06:00
# This workflow should run for any push or pull request which is neither
# a preview build nor a release build.
2021-07-06 11:49:42 -05:00
on:
push:
# tags:
# - "![0-9]+.[0-9]+.[0-9]+-preview"
# - "![0-9]+.[0-9]+.[0-9]+-release"
2021-07-06 11:49:42 -05:00
pull_request:
2022-12-12 09:33:38 -06:00
jobs:
2022-12-12 14:52:50 -06:00
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
name: checkout nosqlbench
2023-01-23 20:18:22 -06:00
with:
node-version: '16'
2022-12-12 14:52:50 -06:00
- uses: actions/setup-java@v3
name: setup java
with:
2023-01-23 20:18:22 -06:00
node-version: '16'
2023-09-28 10:48:09 -05:00
java-version: '21'
2022-12-12 14:52:50 -06:00
java-package: jdk
architecture: x64
2023-09-28 10:48:09 -05:00
distribution: 'oracle'
2022-12-12 14:52:50 -06:00
- name: Cache Maven packages
uses: actions/cache@v1
with:
2023-01-23 20:18:22 -06:00
node-version: '16'
2022-12-12 14:52:50 -06:00
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
2023-01-13 09:54:26 -06:00
- name: Running tests
run: mvn -B test
# Note: the target/coverage-report is not getting generated, involves pom settings not working as expected.
2023-01-28 00:18:19 -06:00
# - name: Collecting reports
# run: tar -zcvf codecov-report.tgz target/coverage-report/**/*
#
2023-01-28 00:18:19 -06:00
# - name: Uploading test coverage
# uses: actions/upload-artifact@v3
# with:
# node-version: '16'
# name: codecov-report
# path: codecov-report.tgz
2023-10-05 14:51:57 -05:00
# - name: Collecting logfiles
# if: success() || failure()
# run: tar -zcvf logfiles.tgz [a-zA-Z]**/logs/*
2022-12-19 14:57:58 -06:00
2023-10-05 14:51:57 -05:00
# - 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@v3
with:
2023-01-23 20:18:22 -06:00
node-version: '16'
name: exported-docs
path: exported_docs.zip
2023-01-30 18:41:58 -06:00
builddocs:
2022-12-12 14:52:50 -06:00
needs: build
runs-on: ubuntu-20.04
2023-02-07 15:53:21 -06:00
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 }}"
2023-01-10 17:13:57 -06:00
- name: download exported_docs
2022-12-12 14:52:50 -06:00
uses: actions/download-artifact@v3
with:
2023-01-23 20:18:22 -06:00
node-version: '16'
2022-12-12 14:52:50 -06:00
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 .
2022-12-12 14:18:11 -06:00
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: |
2023-01-10 17:13:57 -06:00
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: |
2022-12-21 01:23:02 -06:00
set -x
2022-12-12 09:36:35 -06:00
cd nosqlbench-build-docs
2022-12-12 14:52:50 -06:00
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
2022-12-08 15:22:30 -06:00
echo "push completed"