CI #1581
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
#push: | |
workflow_dispatch: | |
workflow_call: | |
pull_request_review: | |
types: [submitted] | |
permissions: write-all | |
jobs: | |
#Sanity: | |
#uses: speedb-io/speedb/.github/workflows/sanity_check.yml@main | |
Build: | |
#needs: [Sanity] | |
if: ${{ github.event.review.state == 'approved' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/heads/release') }} | |
runs-on: [self-hosted, ubuntu, asrunner] | |
strategy: | |
matrix: | |
include: | |
- name: verify build | |
command: cmake .. -GNinja | |
- name: optimized build | |
command: cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja | |
- mame: clang build | |
command: CC=clang CXX=clang++ cmake .. -GNinja | |
container: | |
image: alpine:3.14 | |
steps: | |
- name: Pre-build | |
run: | | |
env | |
rm -rf /usr/share/dotnet || echo "" | |
df -h | |
apk add git | |
echo "nameserver 8.8.8.8" > /etc/resolv.conf | |
apk add bash python3 py3-pip clang clang-extra-tools shellcheck gcc g++ cmake ninja ccache \ | |
openjdk10 gflags-dev snappy-dev lz4-dev bzip2-dev zstd-dev zlib-dev linux-headers openssh-client tar readline-dev | |
python3 -m pip install lint-diffs flake8 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Prepare ccache timestamp | |
id: ccache_cache_timestamp | |
shell: cmake -P {0} | |
run: | | |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) | |
message("::set-output name=timestamp::${current_date}") | |
- name: ccache cache files | |
uses: actions/cache@v2 | |
with: | |
path: ~/.ccache | |
key: ${{runner.os}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} | |
restore-keys: | | |
${{runner.os}}-ccache- | |
- name: ${{ matrix.name }} | |
run: | | |
if [ -d "$GITHUB_WORKSPACE/build" ]; then | |
echo >&2 "error: the build directory should not exist" && false NIK | |
fi | |
if [ -d "~/.ccache" ]; then | |
echo "Already exists" | |
else | |
mkdir -p ~/.ccache | |
ls ~ | grep cache || echo "" | |
touch ~/.ccache/ccache.txt | |
echo "aaa" > ~/.ccache/ccache.txt | |
ls ~/.ccache | |
cat ~/.ccache/ccache.txt | |
fi | |
mkdir -p "$GITHUB_WORKSPACE/build" | |
cd "$GITHUB_WORKSPACE/build" | |
export "CCACHE_BASEDIR=$HOME" | |
export "CCACHE_DIR=$HOME/.ccache" | |
export "CCACHE_COMPILERCHECK=content" | |
${{ matrix.command }} -DPORTABLE=1 -DWITH_GFLAGS=1 \ | |
-DWITH_ZLIB=1 -DWITH_SNAPPY=1 -DWITH_BZ2=1 -DWITH_LZ4=1 -DWITH_ZSTD=1 \ | |
-DWITH_JNI=1 -DJAVA_HOME=/usr/lib/jvm/default-jvm \ | |
-DWITH_BENCHMARK_TOOLS=1 -DWITH_CORE_TOOLS=1 -DWITH_TOOLS=1 \ | |
-DWITH_TESTS=1 -DWITH_ALL_TESTS=1 -DWITH_EXAMPLES=1 | |
ninja | |
#Performance: | |
#if: ${{ github.event.review.state == 'approved' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/heads/release') }} | |
#needs: [Build] | |
#uses: speedb-io/speedb/.github/workflows/perf-test.yml@main | |
QA-Tests: | |
if: ${{ github.event.review.state == 'approved' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/heads/release') }} | |
needs: [Build] | |
uses: speedb-io/speedb/.github/workflows/qa-tests.yml@main | |
Fuzz: | |
if: ${{ github.event.review.state == 'approved' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/heads/release') }} | |
needs: [Build] | |
uses: ./.github/workflows/test_fuzz.yml | |
Check-Licence-And-History: | |
if: ${{ github.event_name == 'pull_request_review' }} | |
uses: ./.github/workflows/check_license_and_history.yml |