|
13 | 13 | - "!gh-pages" # exclude gh-pages branch |
14 | 14 | - "!stage*" # exclude branches beginning with stage |
15 | 15 | jobs: |
| 16 | + lint: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + - uses: actions/setup-python@v3 |
| 21 | + # enforce the same check as pre-commit |
| 22 | + # but only run important checks |
| 23 | + - uses: pre-commit/[email protected] |
| 24 | + with: |
| 25 | + extra_args: codespell --all-files |
| 26 | + - uses: pre-commit/[email protected] |
| 27 | + with: |
| 28 | + extra_args: black --all-files |
| 29 | + - uses: pre-commit/[email protected] |
| 30 | + with: |
| 31 | + extra_args: flake8 --all-files |
| 32 | + test: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + need: lint |
| 35 | + strategy: |
| 36 | + matrix: |
| 37 | + py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| 38 | + mysql_ver: ["8.0"] |
| 39 | + include: |
| 40 | + - py_ver: "3.9" |
| 41 | + mysql_ver: "5.7" |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + - name: Set up Python ${{matrix.py_ver}} |
| 45 | + uses: actions/setup-python@v5 |
| 46 | + with: |
| 47 | + python-version: ${{matrix.py_ver}} |
| 48 | + - name: Run primary tests |
| 49 | + env: |
| 50 | + PY_VER: ${{matrix.py_ver}} |
| 51 | + DJ_PASS: password |
| 52 | + MYSQL_VER: ${{matrix.mysql_ver}} |
| 53 | + DISTRO: alpine |
| 54 | + MINIO_VER: RELEASE.2021-09-03T03-56-13Z |
| 55 | + DOCKER_CLIENT_TIMEOUT: "120" |
| 56 | + COMPOSE_HTTP_TIMEOUT: "120" |
| 57 | + run: | |
| 58 | + export HOST_UID=$(id -u) |
| 59 | + docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest |
16 | 60 | build: |
17 | 61 | runs-on: ubuntu-latest |
| 62 | + need: test |
18 | 63 | strategy: |
19 | 64 | matrix: |
20 | 65 | include: |
|
54 | 99 | name: pip-datajoint-${{env.DJ_VERSION}} |
55 | 100 | path: dist |
56 | 101 | retention-days: 1 |
57 | | - test: |
58 | | - runs-on: ubuntu-latest |
59 | | - strategy: |
60 | | - matrix: |
61 | | - py_ver: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
62 | | - mysql_ver: ["8.0"] |
63 | | - include: |
64 | | - - py_ver: "3.9" |
65 | | - mysql_ver: "5.7" |
66 | | - steps: |
67 | | - - uses: actions/checkout@v4 |
68 | | - - name: Set up Python ${{matrix.py_ver}} |
69 | | - uses: actions/setup-python@v5 |
70 | | - with: |
71 | | - python-version: ${{matrix.py_ver}} |
72 | | - - name: Run primary tests |
73 | | - env: |
74 | | - PY_VER: ${{matrix.py_ver}} |
75 | | - DJ_PASS: password |
76 | | - MYSQL_VER: ${{matrix.mysql_ver}} |
77 | | - DISTRO: alpine |
78 | | - MINIO_VER: RELEASE.2021-09-03T03-56-13Z |
79 | | - DOCKER_CLIENT_TIMEOUT: "120" |
80 | | - COMPOSE_HTTP_TIMEOUT: "120" |
81 | | - run: | |
82 | | - export HOST_UID=$(id -u) |
83 | | - docker compose --profile test up --quiet-pull --build --exit-code-from djtest djtest |
84 | | - lint: |
85 | | - runs-on: ubuntu-latest |
86 | | - strategy: |
87 | | - matrix: |
88 | | - py_ver: ["3.11"] |
89 | | - steps: |
90 | | - - uses: actions/checkout@v4 |
91 | | - - name: Set up Python ${{matrix.py_ver}} |
92 | | - uses: actions/setup-python@v5 |
93 | | - with: |
94 | | - python-version: ${{matrix.py_ver}} |
95 | | - - name: Install dependencies |
96 | | - run: | |
97 | | - python3 -m pip install --upgrade pip |
98 | | - python3 -m pip install ".[test]" |
99 | | - - name: Run syntax tests |
100 | | - run: flake8 datajoint --count --select=E9,F63,F7,F82 --show-source --statistics |
101 | | - - name: Run style tests |
102 | | - run: | |
103 | | - flake8 --ignore=E203,E722,W503 datajoint \ |
104 | | - --count --max-complexity=62 --max-line-length=127 --statistics \ |
105 | | - --per-file-ignores='datajoint/diagram.py:C901' |
106 | | - black --required-version '24.2.0' --check -v datajoint tests --diff |
107 | | - codespell: |
108 | | - name: Check for spelling errors |
109 | | - permissions: |
110 | | - contents: read |
111 | | - runs-on: ubuntu-latest |
112 | | - steps: |
113 | | - - name: Checkout |
114 | | - uses: actions/checkout@v4 |
115 | | - - name: Codespell |
116 | | - uses: codespell-project/actions-codespell@v2 |
117 | | - call-publish-docs: |
118 | | - if: | |
119 | | - github.event_name == 'push' && |
120 | | - startsWith(github.ref, 'refs/tags') |
121 | | - needs: test |
122 | | - runs-on: ubuntu-latest |
123 | | - steps: |
124 | | - - uses: ./.github/workflows/docs.yaml |
125 | 102 | publish-release: |
126 | 103 | if: | |
127 | 104 | github.event_name == 'push' && |
@@ -220,3 +197,12 @@ jobs: |
220 | 197 | && docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \ |
221 | 198 | && docker push "${IMAGE}:latest" \ |
222 | 199 | || echo "skipping 'latest' tag..." |
| 200 | + # only release docs when a release is published |
| 201 | + call-publish-docs: |
| 202 | + if: | |
| 203 | + github.event_name == 'push' && |
| 204 | + startsWith(github.ref, 'refs/tags') |
| 205 | + needs: publish-release |
| 206 | + runs-on: ubuntu-latest |
| 207 | + steps: |
| 208 | + - uses: ./.github/workflows/docs.yaml |
0 commit comments