|
| 1 | +name: Github Autobuild |
| 2 | +on: [ push, pull_request ] |
| 3 | +env: |
| 4 | + CCACHE_COMPRESS: exists means true |
| 5 | + CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime,time_macros |
| 6 | +jobs: |
| 7 | + test-release: |
| 8 | + name: Build and run tests in Release mode |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - name: Install dependencies |
| 12 | + run: | |
| 13 | + sudo apt-get install -y \ |
| 14 | + ccache \ |
| 15 | + parallel \ |
| 16 | + libboost-thread-dev \ |
| 17 | + libboost-iostreams-dev \ |
| 18 | + libboost-date-time-dev \ |
| 19 | + libboost-system-dev \ |
| 20 | + libboost-filesystem-dev \ |
| 21 | + libboost-program-options-dev \ |
| 22 | + libboost-chrono-dev \ |
| 23 | + libboost-test-dev \ |
| 24 | + libboost-context-dev \ |
| 25 | + libboost-regex-dev \ |
| 26 | + libboost-coroutine-dev |
| 27 | + - uses: actions/checkout@v1 |
| 28 | + with: |
| 29 | + submodules: recursive |
| 30 | + - name: Configure |
| 31 | + run: | |
| 32 | + mkdir -p _build |
| 33 | + pushd _build |
| 34 | + cmake -D CMAKE_BUILD_TYPE=Release \ |
| 35 | + -D CMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \ |
| 36 | + -D CMAKE_C_COMPILER=gcc \ |
| 37 | + -D CMAKE_C_COMPILER_LAUNCHER=ccache \ |
| 38 | + -D CMAKE_CXX_COMPILER=g++ \ |
| 39 | + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ |
| 40 | + .. |
| 41 | + popd |
| 42 | + - name: Load Cache |
| 43 | + uses: actions/cache@v1 |
| 44 | + with: |
| 45 | + path: ccache |
| 46 | + key: ccache-release-${{ github.ref }}-${{ github.sha }} |
| 47 | + restore-keys: | |
| 48 | + ccache-release-${{ github.ref }}- |
| 49 | + ccache-release- |
| 50 | + ccache- |
| 51 | + - name: Build |
| 52 | + run: | |
| 53 | + export CCACHE_DIR="$GITHUB_WORKSPACE/ccache" |
| 54 | + mkdir -p "$CCACHE_DIR" |
| 55 | + make -j 2 -C _build |
| 56 | + - name: Test |
| 57 | + run: | |
| 58 | + parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_ |
| 59 | + all_tests |
| 60 | + bloom_test -- README.md |
| 61 | + ecc_test README.md |
| 62 | + hmac_test |
| 63 | + task_cancel_test |
| 64 | + _EOT_ |
| 65 | + test-debug: |
| 66 | + name: Build and run tests in Debug mode |
| 67 | + runs-on: ubuntu-latest |
| 68 | + steps: |
| 69 | + - name: Install dependencies |
| 70 | + run: | |
| 71 | + sudo apt-get install -y \ |
| 72 | + ccache \ |
| 73 | + parallel \ |
| 74 | + libboost-thread-dev \ |
| 75 | + libboost-iostreams-dev \ |
| 76 | + libboost-date-time-dev \ |
| 77 | + libboost-system-dev \ |
| 78 | + libboost-filesystem-dev \ |
| 79 | + libboost-program-options-dev \ |
| 80 | + libboost-chrono-dev \ |
| 81 | + libboost-test-dev \ |
| 82 | + libboost-context-dev \ |
| 83 | + libboost-regex-dev \ |
| 84 | + libboost-coroutine-dev |
| 85 | + - uses: actions/checkout@v1 |
| 86 | + with: |
| 87 | + submodules: recursive |
| 88 | + - name: Configure |
| 89 | + run: | |
| 90 | + mkdir -p _build |
| 91 | + pushd _build |
| 92 | + cmake -D CMAKE_BUILD_TYPE=Debug \ |
| 93 | + -D CMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \ |
| 94 | + -D CMAKE_C_COMPILER=gcc \ |
| 95 | + -D CMAKE_C_COMPILER_LAUNCHER=ccache \ |
| 96 | + -D CMAKE_CXX_COMPILER=g++ \ |
| 97 | + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ |
| 98 | + .. |
| 99 | + popd |
| 100 | + - name: Load Cache |
| 101 | + uses: actions/cache@v1 |
| 102 | + with: |
| 103 | + path: ccache |
| 104 | + key: ccache-debug-${{ github.ref }}-${{ github.sha }} |
| 105 | + restore-keys: | |
| 106 | + ccache-debug-${{ github.ref }}- |
| 107 | + ccache-debug- |
| 108 | + ccache- |
| 109 | + - name: Build |
| 110 | + run: | |
| 111 | + export CCACHE_DIR="$GITHUB_WORKSPACE/ccache" |
| 112 | + mkdir -p "$CCACHE_DIR" |
| 113 | + make -j 2 -C _build |
| 114 | + - name: Test |
| 115 | + run: | |
| 116 | + parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_ |
| 117 | + all_tests |
| 118 | + bloom_test -- README.md |
| 119 | + ecc_test README.md |
| 120 | + hmac_test |
| 121 | + task_cancel_test |
| 122 | + _EOT_ |
0 commit comments