Skip to content

Commit 7b1d5fb

Browse files
author
Drew Yang
committed
ci: 🎨 re-organize ci
1 parent 7d2f539 commit 7b1d5fb

File tree

3 files changed

+56
-70
lines changed

3 files changed

+56
-70
lines changed

‎.github/workflows/close_inactive_issues.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
close-issue-message: "This issue was closed because it has been inactive for 365 days since being marked as stale, please reopen if it's still applicable."
2020
days-before-pr-stale: 45 # for initial period, suggest 15
2121
days-before-pr-close: 365 # for initial period, suggest 30
22-
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/development.yaml‎

Lines changed: 54 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,53 @@ on:
1313
- "!gh-pages" # exclude gh-pages branch
1414
- "!stage*" # exclude branches beginning with stage
1515
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
1660
build:
1761
runs-on: ubuntu-latest
62+
need: test
1863
strategy:
1964
matrix:
2065
include:
@@ -54,74 +99,6 @@ jobs:
5499
name: pip-datajoint-${{env.DJ_VERSION}}
55100
path: dist
56101
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
125102
publish-release:
126103
if: |
127104
github.event_name == 'push' &&
@@ -220,3 +197,12 @@ jobs:
220197
&& docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \
221198
&& docker push "${IMAGE}:latest" \
222199
|| 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

‎.github/workflows/label_issues.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1616
GH_REPO: ${{ github.repository }}
1717
NUMBER: ${{ github.event.issue.number }}
18-
LABELS: triage
18+
LABELS: triage

0 commit comments

Comments
 (0)