Skip to content

Add Windows CI support #441

Add Windows CI support

Add Windows CI support #441

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
pre-commit:
name: Pre-commit Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install pre-commit
- name: Cache pre-commit hooks
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure
test:
name: Bazel Tests (Bazel ${{ matrix.bazel-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
bazel-version: ["7.x", "8.x", "9.x"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Bazel
uses: actions/cache@v4
with:
path: |
~/.cache/bazel-repo
~/.cache/bazelisk
key: bazel-${{ matrix.os }}-${{ matrix.bazel-version }}-${{ hashFiles('MODULE.bazel.lock') }}
restore-keys: |
bazel-${{ matrix.os }}-${{ matrix.bazel-version }}-
bazel-${{ matrix.os }}-
- name: Run Bazel tests
shell: bash
env:
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
run: |
bazel test --config=ci --repository_cache="$HOME/.cache/bazel-repo" //... --test_output=errors
- name: Build all targets
shell: bash
env:
USE_BAZEL_VERSION: ${{ matrix.bazel-version }}
run: |
bazel build --config=ci --repository_cache="$HOME/.cache/bazel-repo" //...
typecheck:
name: Type Checking
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Bazel
uses: actions/cache@v4
with:
path: |
~/.cache/bazel-repo
~/.cache/bazelisk
key: bazel-typecheck-ubuntu-latest-${{ hashFiles('MODULE.bazel.lock') }}
restore-keys: |
bazel-typecheck-ubuntu-latest-
- name: Run type checking with ty
run: bazel build --config=ci --config=typecheck --repository_cache="$HOME/.cache/bazel-repo" //...
failure-tests:
name: Failure Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Bazel
uses: actions/cache@v4
with:
path: |
~/.cache/bazel-repo-failure
~/.cache/bazelisk
key: bazel-failure-tests-${{ matrix.os }}-${{ hashFiles('MODULE.bazel.lock') }}
restore-keys: |
bazel-failure-tests-${{ matrix.os }}-
- name: Run failure tests
shell: bash
run: |
export BAZEL_EXTRA_OPTS="--config=ci --repository_cache=$HOME/.cache/bazel-repo-failure"
./fire/starlark/failure_test/run_failure_tests.sh
integration-test:
name: Integration Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Bazel
uses: actions/cache@v4
with:
path: |
~/.cache/bazel-repo
~/.cache/bazelisk
key: bazel-integration-${{ matrix.os }}-py${{ matrix.python-version }}-${{ hashFiles('integration_test/MODULE.bazel.lock') }}
restore-keys: |
bazel-integration-${{ matrix.os }}-py${{ matrix.python-version }}-
bazel-integration-${{ matrix.os }}-
- name: Run integration test
shell: bash
run: |
export BAZEL_EXTRA_OPTS="--config=ci --repository_cache=$HOME/.cache/bazel-repo"
cd integration_test
./run.sh --python-version ${{ matrix.python-version }}