| name: Bazel Tests |
| |
| on: [push, pull_request, workflow_dispatch] |
| |
| jobs: |
| cc-tests: |
| name: C++ Bazel Tests |
| runs-on: ubuntu-latest |
| timeout-minutes: 60 |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Mount Cache |
| uses: actions/cache@v3 |
| with: |
| path: ~/.cache/bazel/ |
| key: bazel-cc-cache |
| - name: Install packages for the PostgreSQL extension |
| run: sudo apt-get install -y make libreadline-dev bison flex |
| - name: Ensure bazelisk is installed |
| run: bazelisk --version |
| - name: Build C++ Workspace |
| working-directory: cc |
| run: bazelisk build ... |
| - name: Test C++ Workspace (without long and eternal tests) |
| working-directory: cc |
| run: bazelisk test --test_timeout_filters=-long,-eternal ... |
| - name: Build C++ Examples |
| working-directory: examples/cc |
| run: bazelisk build ... |
| - name: Test C++ Examples |
| working-directory: examples/cc |
| run: bazelisk test ... |
| |
| java-tests: |
| name: Java Bazel Tests |
| runs-on: ubuntu-latest |
| timeout-minutes: 60 |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Mount Cache |
| uses: actions/cache@v3 |
| with: |
| path: ~/.cache/bazel/ |
| key: bazel-java-cache |
| - name: Ensure bazelisk is installed |
| run: bazelisk --version |
| - name: Build Java Workspace |
| working-directory: java |
| run: bazelisk build ... |
| - name: Test Java Workspace (without long and eternal tests) |
| working-directory: java |
| run: bazelisk test --test_timeout_filters=-long,-eternal ... |
| - name: Build Java Examples |
| working-directory: examples/java |
| run: bazelisk build ... |
| |
| pipelinedp4j-tests: |
| name: PipelineDP4J Bazel Tests |
| runs-on: ubuntu-latest |
| timeout-minutes: 60 |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Mount Cache |
| uses: actions/cache@v3 |
| with: |
| path: ~/.cache/bazel/ |
| key: bazel-pipelinedp4j-cache |
| - name: Ensure bazelisk is installed |
| run: bazelisk --version |
| - name: Build PipelineDP4J Workspace |
| working-directory: pipelinedp4j |
| run: bazelisk build ... |
| - name: Test PipelineDP4J Workspace (without long and eternal tests) |
| working-directory: pipelinedp4j |
| run: bazelisk test --test_timeout_filters=-long,-eternal ... |
| - name: Create dummy input file for examples |
| working-directory: examples/pipelinedp4j |
| run: | |
| cat << EOF > input.csv |
| 4505,573364,5,2004-13-29 |
| 4501,2532865,4,2005-11-06 |
| 4501,573364,2,2005-02-25 |
| 4500,2532865,2,2004-12-12 |
| 4505,1265574,4,2003-05-05 |
| 4505,2532865,1,2004-12-12 |
| EOF |
| - name: Run Beam Example |
| working-directory: examples/pipelinedp4j |
| run: bazelisk run beam/src/main/java/com/google/privacy/differentialprivacy/pipelinedp4j/examples:BeamExample -- --inputFilePath="$(pwd)/input.csv" --outputFilePath="$(pwd)/output.txt" |
| - name: Run Spark Example |
| working-directory: examples/pipelinedp4j |
| run: bazelisk run spark/src/main/java/com/google/privacy/differentialprivacy/pipelinedp4j/examples:SparkExample -- --inputFilePath="$(pwd)/input.csv" --outputFolder="$(pwd)/output" |
| - name: Run Spark DataFrame Example |
| working-directory: examples/pipelinedp4j |
| run: bazelisk run spark/src/main/java/com/google/privacy/differentialprivacy/pipelinedp4j/examples:SparkDataFrameExample -- --inputFilePath="$(pwd)/input.csv" --outputFolder="$(pwd)/output" |
| |
| zetasql-build: |
| name: ZetaSQL Examples Build Test |
| runs-on: ubuntu-latest |
| timeout-minutes: 60 |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Mount Cache |
| uses: actions/cache@v3 |
| with: |
| path: ~/.cache/bazel/ |
| key: bazel-zetasql-examples-cache |
| - name: Ensure bazelisk is installed |
| run: bazelisk --version |
| - name: Build ZetaSQL Examples |
| working-directory: examples/zetasql |
| run: bazelisk build ... |
| |
| python-tests: |
| name: Python Tests |
| runs-on: ubuntu-latest |
| timeout-minutes: 60 |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Set up Python 3.10 |
| uses: actions/setup-python@v4 |
| with: |
| python-version: '3.10' |
| - name: Install Python dependencies |
| run: | |
| python -m pip install --upgrade pip |
| python -m pip install --upgrade setuptools |
| - name: Mount Cache |
| uses: actions/cache@v3 |
| with: |
| path: ~/.cache/bazel/ |
| key: bazel-python-cache |
| - name: Ensure bazelisk is installed |
| run: bazelisk --version |
| # TODO: Remove the --use-pep517 flag when migrating to Python Wheel. |
| # `pip check` is required since `pip install` always terminates successfully, even on errors. |
| - name: Build and Test dp_accounting |
| working-directory: python/dp_accounting |
| run: | |
| bazelisk build ... |
| bazelisk test --test_timeout_filters=-long,-eternal ... |
| python3 -m venv ./venv |
| ./venv/bin/python3 -m pip install --use-pep517 . |
| ./venv/bin/python3 -m pip check . |
| ./venv/bin/python3 -m unittest discover -p '*_test.py' |
| rm -rf ./venv |
| - name: Build and Test dp_auditorium |
| working-directory: python/dp_auditorium |
| run: | |
| bazelisk build ... |
| bazelisk test --test_timeout_filters=-long,-eternal ... |
| python3 -m venv ./venv |
| ./venv/bin/python3 -m pip install --use-pep517 . |
| ./venv/bin/python3 -m pip check . |
| ./venv/bin/python3 -m unittest discover -p '*_test.py' |
| rm -rf ./venv |
| - name: Build and Test learning |
| working-directory: learning |
| run: | |
| bazelisk build ... |
| bazelisk test --test_output=errors --test_timeout_filters=-eternal --test_tag_filters=-nokokoro --test_verbose_timeout_warnings ... |
| python3 -m venv ./venv |
| ./venv/bin/python3 -m pip install --use-pep517 . |
| ./venv/bin/python3 -m pip check . |
| ./venv/bin/python3 -m unittest discover -p '*_test.py' |
| rm -rf ./venv |