|
12 | 12 | ARTIFACT_PIKA_NAME: artifact-pika |
13 | 13 |
|
14 | 14 | jobs: |
| 15 | + |
15 | 16 | build_on_ubuntu: |
16 | | - # The CMake configure and build commands are platform-agnostic and should work equally well on Windows or Mac. |
17 | | - # You can convert this to a matrix build if you need cross-platform coverage. |
18 | | - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
19 | | - runs-on: ubuntu-latest |
| 17 | + runs-on: ubuntu-22.04 |
20 | 18 |
|
21 | 19 | steps: |
22 | | - - name: Free Disk Space (Ubuntu Host) |
23 | | - run: | |
24 | | - sudo rm -rf /usr/share/dotnet |
25 | | - sudo rm -rf /usr/local/lib/android |
26 | | - sudo rm -rf /opt/ghc |
27 | | - sudo rm -rf /opt/hostedtoolcache/CodeQL |
28 | | - sudo docker system prune -af |
29 | 20 | - uses: actions/checkout@v4 |
30 | 21 |
|
31 | | - - name: Set up Go |
32 | | - uses: actions/setup-go@v5 |
33 | | - with: |
34 | | - go-version: 1.19 |
35 | | - |
36 | | - - name: ccache |
37 | | - uses: hendrikmuhs/[email protected] |
38 | | - with: |
39 | | - key: ubuntu-latest |
40 | | - |
41 | | - - name: Install Deps |
| 22 | + - name: Build Docker image |
42 | 23 | run: | |
43 | | - sudo apt-get update |
44 | | - sudo apt-get install -y autoconf libprotobuf-dev protobuf-compiler clang-tidy |
45 | | -
|
46 | | - - name: Configure CMake |
47 | | - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
48 | | - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
49 | | - run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache |
50 | | - |
51 | | - - name: Build |
52 | | - # Build your program with the given configuration |
53 | | - run: cmake --build build --config ${{ env.BUILD_TYPE }} |
| 24 | + docker build -t pika-ci -f ci/Dockerfile . |
54 | 25 |
|
55 | | - - name: Cleanup |
| 26 | + - name: Build Pika inside Docker |
56 | 27 | run: | |
57 | | - rm -rf ./buildtrees |
58 | | -
|
59 | | - - uses: actions/upload-artifact@v4 |
60 | | - with: |
61 | | - name: ${{ env.ARTIFACT_PIKA_NAME }} |
62 | | - path: ${{ github.workspace }}/build/pika |
63 | | - |
64 | | - - name: Test |
65 | | - working-directory: ${{ github.workspace }}/build |
66 | | - # Execute tests defined by the CMake configuration. |
67 | | - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
68 | | - run: ctest -C ${{ env.BUILD_TYPE }} |
| 28 | + docker run --rm \ |
| 29 | + -v ${{ github.workspace }}:/work \ |
| 30 | + -w /work \ |
| 31 | + pika-ci \ |
| 32 | + bash -c "rm -rf build buildtrees && \ |
| 33 | + cmake -B build -DCMAKE_BUILD_TYPE=Release -DUSE_PIKA_TOOLS=ON && \ |
| 34 | + cmake --build build -j2" |
| 35 | +
|
| 36 | + - name: Run CTest |
| 37 | + run: | |
| 38 | + docker run --rm \ |
| 39 | + -v ${{ github.workspace }}:/work \ |
| 40 | + -w /work/build \ |
| 41 | + pika-ci \ |
| 42 | + ctest --output-on-failure |
69 | 43 |
|
70 | | - - name: Unit Test |
71 | | - working-directory: ${{ github.workspace }} |
72 | | - run: ./pikatests.sh all clean |
| 44 | + - name: Run Unit Tests |
| 45 | + run: | |
| 46 | + docker run --rm \ |
| 47 | + -v ${{ github.workspace }}:/work \ |
| 48 | + -w /work \ |
| 49 | + pika-ci \ |
| 50 | + ./pikatests.sh all clean |
73 | 51 |
|
74 | | - # master on port 9221, slave on port 9231, all with 2 db |
75 | | - - name: Start codis, pika master and pika slave |
76 | | - working-directory: ${{ github.workspace }}/build |
| 52 | + - name: Start Codis and Pika Integration |
77 | 53 | run: | |
78 | | - chmod +x ../tests/integration/start_master_and_slave.sh |
79 | | - ../tests/integration/start_master_and_slave.sh |
80 | | - chmod +x ../tests/integration/start_codis.sh |
81 | | - ../tests/integration/start_codis.sh |
| 54 | + docker run --rm \ |
| 55 | + -v ${{ github.workspace }}:/work \ |
| 56 | + -w /work/build \ |
| 57 | + pika-ci \ |
| 58 | + bash -c " |
| 59 | + chmod +x ../tests/integration/start_master_and_slave.sh && |
| 60 | + ../tests/integration/start_master_and_slave.sh && |
| 61 | + chmod +x ../tests/integration/start_codis.sh && |
| 62 | + ../tests/integration/start_codis.sh |
| 63 | + " |
82 | 64 |
|
83 | 65 | - name: Run Go E2E Tests |
84 | | - working-directory: ${{ github.workspace }}/build |
85 | 66 | run: | |
86 | | - cd ../tools/pika_keys_analysis/ |
87 | | - go test -v ./... |
88 | | - cd ../../tests/integration/ |
89 | | - chmod +x integrate_test.sh |
90 | | - sh integrate_test.sh |
91 | | -
|
| 67 | + docker run --rm \ |
| 68 | + -v ${{ github.workspace }}:/work \ |
| 69 | + -w /work/build \ |
| 70 | + pika-ci \ |
| 71 | + bash -c " |
| 72 | + find . -name 'pika.conf' -exec sed -i 's/loglevel : info/loglevel : error/g' {} + && |
| 73 | + find . -name 'pika.conf' -exec sed -i 's/loglevel : debug/loglevel : error/g' {} + && |
| 74 | + cd ../tools/pika_keys_analysis/ && |
| 75 | + go test -v ./... && |
| 76 | + cd ../../tests/integration/ && |
| 77 | + chmod +x integrate_test.sh && |
| 78 | + sh integrate_test.sh |
| 79 | + " |
| 80 | + |
92 | 81 | build_on_rocky: |
93 | 82 | runs-on: ubuntu-latest |
94 | 83 | container: |
@@ -272,6 +261,7 @@ jobs: |
272 | 261 | chmod +x integrate_test.sh |
273 | 262 | sh integrate_test.sh |
274 | 263 |
|
| 264 | +
|
275 | 265 | build_on_macos: |
276 | 266 |
|
277 | 267 | runs-on: macos-14 |
|
0 commit comments