Use JSCOnly port for CI — only needs ICU, no GTK/platform deps #10
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 validate-dnr-rules | |
| on: | |
| push: | |
| branches: [ghostery/*] | |
| paths: | |
| - 'ghostery/validate-dnr-rules/**' | |
| - 'Source/WebCore/contentextensions/**' | |
| - 'Source/WTF/**' | |
| - 'CMakeLists.txt' | |
| - '.github/workflows/validate-dnr-rules.yml' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| name: linux-x64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| cmake ninja-build pkg-config ruby unifdef libicu-dev | |
| - name: Cache CMake build | |
| uses: actions/cache@v4 | |
| with: | |
| path: build | |
| key: cmake-${{ matrix.name }}-${{ hashFiles('Source/WTF/**', 'Source/WebCore/contentextensions/**', 'ghostery/validate-dnr-rules/**') }} | |
| restore-keys: | | |
| cmake-${{ matrix.name }}- | |
| - name: Configure | |
| run: | | |
| cmake -B build -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DPORT=JSCOnly \ | |
| . | |
| - name: Build | |
| run: cmake --build build --target validate-dnr-rules | |
| - name: Test | |
| run: | | |
| cat > /tmp/test-rules.json << 'RULES' | |
| [ | |
| {"id":1,"priority":1,"action":{"type":"block"},"condition":{"regexFilter":"ad[0-9]{2}\\.js"}}, | |
| {"id":2,"priority":1,"action":{"type":"block"},"condition":{"regexFilter":"(?:ads|tracking)\\.com"}}, | |
| {"id":3,"priority":1,"action":{"type":"block"},"condition":{"regexFilter":"tracker\\d+\\.js"}}, | |
| {"id":4,"priority":1,"action":{"type":"block"},"condition":{"regexFilter":"pixel\\b"}} | |
| ] | |
| RULES | |
| ./build/validate-dnr-rules /tmp/test-rules.json | |
| - name: Binary info | |
| run: | | |
| file build/validate-dnr-rules | |
| du -h build/validate-dnr-rules | |
| ldd build/validate-dnr-rules || true | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: validate-dnr-rules-${{ matrix.name }} | |
| path: build/validate-dnr-rules |