aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/build_and_test.yml
blob: da45f4f90653487cdcd205a9e6159033ee60a0cc (plain) (blame)
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
name: Build-and-Test

on: 
  schedule:
    - cron: "0 1 * * *"
  workflow_dispatch:

jobs:
  build:
    strategy:
      matrix:
        arch: [ X64, ARM64 ]
      fail-fast: false

    runs-on: [ self-hosted, "${{matrix.arch}}" ]
    
    steps:
    - name: Checkout
      uses: actions/checkout@v3
    - name: Configure
      shell: bash
      run: |
        mkdir -p ../build
        cd ../build
        rm -rf *
        cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_TOOLCHAIN_FILE=../ydb/clang.toolchain ../ydb
    - name: Build
      shell: bash
      run: |
        cd ../build
        ninja
    - name: Test
      shell: bash
      run: |
        cd ../build/ydb
        rm -rf $(pwd)/../../tmp/*
        rm -rf $(pwd)/../../test_reports/*
        mkdir -p ../../artifacts
        rm -rf $(pwd)/../../artifacts/*
        
        # Sed removes coloring from the output
        TMPDIR=$(pwd)/../../tmp GTEST_OUTPUT="xml:$(pwd)/../../test_reports/" \
          ctest -j28 --timeout 1200 --force-new-ctest-process --output-on-failure \
                --output-junit $(pwd)/../../test_reports/ctest_report.xml | \
          sed -e 's/\x1b\[[0-9;]*m//g' | \
          tee >(gzip --stdout > ../../artifacts/${{matrix.arch}}-stdout.gz) | \
          grep -E '(Test\s*#.*\*\*\*|\[FAIL\])|.*tests passed,.*tests failed out of' | \
          tee -a $GITHUB_STEP_SUMMARY
    - name: Upload S3
      uses: shallwefootball/s3-upload-action@master
      if: always()
      with:
        aws_key_id: ${{ secrets.AWS_KEY_ID }}
        aws_secret_access_key: ${{ secrets.AWS_KEY_VALUE}}
        aws_bucket: ydb-tech-ci
        source_dir: ../artifacts
        destination_dir: '${{ github.repository }}/${{github.workflow}}/${{ github.run_id }}'
        endpoint: https://storage.yandexcloud.net