|
7 | 7 | branches: ["main"] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build-and-test: |
11 | | - name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" |
12 | | - runs-on: "${{ matrix.os }}" |
13 | | - |
| 10 | + lint: |
| 11 | + name: "Lint: Python ${{ matrix.python-version }} on ${{ matrix.os }}" |
| 12 | + runs-on: ${{ matrix.os }} |
14 | 13 | strategy: |
15 | 14 | matrix: |
16 | 15 | python-version: ["3.11"] |
17 | 16 | os: [ubuntu-latest] |
18 | | - |
19 | 17 | steps: |
20 | 18 | - uses: "actions/checkout@v6" |
21 | 19 | - uses: "actions/setup-python@v6" |
22 | 20 | with: |
23 | | - python-version: "${{ matrix.python-version }}" |
24 | | - - name: Install dependencies |
| 21 | + python-version: ${{ matrix.python-version }} |
| 22 | + cache: "pip" |
| 23 | + - name: Install Linting Tools |
25 | 24 | run: | |
26 | 25 | python -m pip install --upgrade pip |
27 | | - pip install build wheel |
28 | | - pip install pylint pytype flake8 pylint-exit pydocstyle |
29 | | - pip install -e .[dev] |
30 | | - pip install -r docs/requirements.txt |
31 | | - pip install crc32c |
32 | | - - name: Run flake8 |
33 | | - run: flake8 jax_privacy tests examples |
| 26 | + pip install -e ".[lint,examples,test]" |
| 27 | + - name: Run flake |
| 28 | + run: | |
| 29 | + flake8 jax_privacy tests examples |
34 | 30 | - name: Run pydocstyle |
35 | 31 | run: | |
36 | 32 | pydocstyle --convention=google --add-ignore=D101,D102,D103,D105,D202,D402 jax_privacy/ |
37 | 33 | - name: Run pylint |
| 34 | + shell: bash |
38 | 35 | run: | |
39 | 36 | pylint jax_privacy || pylint-exit -efail -wfail -cfail -rfail $? |
40 | 37 | pylint examples || pylint-exit -efail -wfail -cfail -rfail $? |
41 | 38 | pylint tests -d W0101,W0212,C0114 || pylint-exit -efail -wfail -cfail -rfail $? |
42 | | - shell: bash |
43 | 39 | - name: Run pytype |
44 | 40 | run: | |
45 | 41 | pytype jax_privacy -k |
46 | 42 | pytype tests -k |
47 | 43 | pytype examples -k |
48 | | - - name: Run doctests |
| 44 | +
|
| 45 | + test: |
| 46 | + name: "Unit Test: Python ${{ matrix.python-version }} on ${{ matrix.os }}" |
| 47 | + runs-on: ${{ matrix.os }} |
| 48 | + strategy: |
| 49 | + matrix: |
| 50 | + python-version: ["3.11"] |
| 51 | + os: [ubuntu-latest] |
| 52 | + steps: |
| 53 | + - uses: "actions/checkout@v6" |
| 54 | + - uses: "actions/setup-python@v6" |
| 55 | + with: |
| 56 | + python-version: ${{ matrix.python-version }} |
| 57 | + cache: "pip" |
| 58 | + - name: Install Test Dependencies |
| 59 | + run: | |
| 60 | + python -m pip install --upgrade pip |
| 61 | + pip install -e ".[test,examples]" |
| 62 | + - name: Run Doctests |
49 | 63 | run: | |
50 | | - pytest --doctest-modules jax_privacy/ |
51 | | - - name: Run tests |
| 64 | + pytest --doctest-modules jax_privacy |
| 65 | + - name: Run Standard Tests |
52 | 66 | run: | |
53 | 67 | pytest -n auto tests/ -k "not matrix_factorization and not distributed_noise_generation_test and not sharding_utils_test" |
54 | 68 | pytest -n auto tests/ -k "distributed_noise_generation_test" |
55 | 69 | pytest -n auto tests/ -k "sharding_utils_test" |
| 70 | +
|
| 71 | + matrix-tests: |
| 72 | + name: "Matrix Tests: Python ${{ matrix.python-version }} on ${{ matrix.os }}" |
| 73 | + needs: lint |
| 74 | + runs-on: "${{ matrix.os }}" |
| 75 | + strategy: |
| 76 | + matrix: |
| 77 | + python-version: ["3.11"] |
| 78 | + os: [ubuntu-latest] |
| 79 | + steps: |
| 80 | + - uses: "actions/checkout@v6" |
| 81 | + - uses: "actions/setup-python@v6" |
| 82 | + with: |
| 83 | + python-version: "${{ matrix.python-version }}" |
| 84 | + cache: "pip" |
| 85 | + - name: Install Dependencies |
| 86 | + run: | |
| 87 | + python -m pip install --upgrade pip |
| 88 | + pip install -e ".[test]" |
| 89 | + - name: Run Heavy Tests |
| 90 | + run: | |
56 | 91 | export HYPOTHESIS_PROFILE=dpftrl_default |
57 | 92 | pytest -n auto tests/ -k "matrix_factorization" --ignore=tests/matrix_factorization/buffered_toeplitz_test.py |
58 | 93 | shell: bash |
59 | | - - name: Build docs |
| 94 | + |
| 95 | + docs: |
| 96 | + name: "Docs: Python ${{ matrix.python-version }} on ${{ matrix.os }}" |
| 97 | + needs: lint |
| 98 | + runs-on: "${{ matrix.os }}" |
| 99 | + strategy: |
| 100 | + matrix: |
| 101 | + python-version: ["3.11"] |
| 102 | + os: [ubuntu-latest] |
| 103 | + steps: |
| 104 | + - uses: "actions/checkout@v6" |
| 105 | + - uses: "actions/setup-python@v6" |
| 106 | + with: |
| 107 | + python-version: "${{ matrix.python-version }}" |
| 108 | + cache: "pip" |
| 109 | + - name: Install Docs Dependencies |
| 110 | + run: | |
| 111 | + python -m pip install --upgrade pip |
| 112 | + pip install -e ".[docs]" |
| 113 | + - name: Build Sphinx |
60 | 114 | run: | |
61 | | - cd docs |
62 | | - sphinx-build -W -b html . _build/html |
63 | | - cd .. |
| 115 | + cd docs |
| 116 | + sphinx-build -W -b html . _build/html |
0 commit comments