Merge pull request #110 from thawk105/fix-cicada-mvto-use-after-move #170
This file contains hidden or 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: build | |
| on: | |
| push: | |
| # Run on every branch. (Pull-request runs may double up for same-repo | |
| # PRs; that's the trade-off for getting CI feedback on topic branches.) | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/**' | |
| - '.devcontainer/**' | |
| - '.github/workflows/devcontainer-image.yml' | |
| pull_request: | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/**' | |
| - '.devcontainer/**' | |
| - '.github/workflows/devcontainer-image.yml' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # Run the job inside the slim CI image (sibling of the human-facing | |
| # :latest devcontainer image — same base layers, dev-only tooling | |
| # like zsh/clang-format/sudo/openssh-client stripped out). Both tags | |
| # are built and pushed from the same multi-stage Dockerfile by | |
| # .github/workflows/devcontainer-image.yml. | |
| # | |
| # --user root: the image's default is vscode (uid=1000), but the | |
| # GHA runner's work dir (/__w/_temp, bind-mounted into the container) | |
| # is owned by the runner user on the host. Without root, actions' | |
| # housekeeping writes (e.g. actions/checkout's saveState) hit EACCES. | |
| # Running as root inside the container is fine — it's isolated. | |
| container: | |
| image: ghcr.io/thawk105/ccbench-devcontainer:ci | |
| options: --user root | |
| timeout-minutes: 30 | |
| env: | |
| # Pin ccache dir so actions/cache and ccache agree on the path. | |
| # (ccache 4+ defaults to ~/.cache/ccache; older docs say ~/.ccache.) | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # actions/checkout writes its own safe.directory, but later steps | |
| # invoke git from a fresh shell (`sh -e {0}`) where that scoped | |
| # config is not always picked up. Set it once globally so every | |
| # `git ...` call in this job sees the workspace as safe. | |
| - name: Mark workspace as safe for git | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| # ccache deduplicates compilations across the 34 binaries (each | |
| # protocol's CMakeLists.txt currently compiles common/*.cc and its | |
| # own .cc files separately for every target). | |
| - name: Restore ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.CCACHE_DIR }} | |
| key: ccache-${{ runner.os }}-${{ github.sha }} | |
| restore-keys: | | |
| ccache-${{ runner.os }}- | |
| - name: Configure ccache | |
| run: | | |
| ccache --max-size=400M | |
| ccache --zero-stats | |
| - name: Configure (top-level cmake) | |
| # Sanitizer adds significant link-time memory/cpu cost and CI does | |
| # not run binaries, so it adds no value here. Use Release for the | |
| # build verification. Wire ccache via compiler launchers. | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DENABLE_SANITIZER=OFF \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| - name: Build all protocols | |
| # Release without sanitizer is light enough to use full runner | |
| # parallelism. (Debug+ASan needed -j2 to avoid OOM, but we no | |
| # longer build that here.) | |
| run: cmake --build build -j $(nproc) | |
| - name: ccache stats | |
| if: always() | |
| run: ccache --show-stats |