fix: arch version and reduce docker image size and caching #424
Workflow file for this run
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: | |
| branches: [main] | |
| paths-ignore: | |
| - "docs/**" | |
| - "**.md" | |
| - ".agent/**" | |
| - ".editorconfig" | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| changes: | |
| name: Detect build-relevant changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| relevant: ${{ steps.filter.outputs.relevant }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect relevant file changes | |
| id: filter | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event_name }}" != "pull_request" ]; then | |
| echo "relevant=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| relevant=false | |
| while IFS= read -r file; do | |
| [ -z "$file" ] && continue | |
| case "$file" in | |
| docs/*|*.md|.agent/*|.editorconfig) | |
| ;; | |
| *) | |
| relevant=true | |
| break | |
| ;; | |
| esac | |
| done < <(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}") | |
| echo "relevant=$relevant" >> "$GITHUB_OUTPUT" | |
| build: | |
| needs: changes | |
| if: needs.changes.outputs.relevant == 'true' | |
| name: Build (${{ matrix.name }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| include: | |
| - name: Ubuntu / GCC | |
| os: ubuntu-latest | |
| generator: Ninja | |
| shell: bash | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 1 | |
| - name: Install dependencies (Linux) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| cmake ninja-build \ | |
| libgl1-mesa-dev \ | |
| libx11-dev libxrandr-dev libxi-dev \ | |
| libxinerama-dev libxcursor-dev \ | |
| libpipewire-0.3-dev pkg-config | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| - name: Cache build directory | |
| uses: actions/cache@v5 | |
| with: | |
| path: build | |
| key: build-${{ matrix.os }}-${{ hashFiles('CMakeLists.txt', 'src/**') }} | |
| restore-keys: | | |
| build-${{ matrix.os }}- | |
| - name: Configure (Debug) | |
| run: > | |
| cmake -S . -B build | |
| -G "${{ matrix.generator }}" | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DCMAKE_COLOR_DIAGNOSTICS=ON | |
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 | |
| shell: bash | |
| - name: Build | |
| run: cmake --build build --config Debug -j 4 | |
| shell: bash |