Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run all pre-checks in a single job #2224

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/workflows/_component_prechecks.yml

This file was deleted.

35 changes: 9 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,7 @@ jobs:
run: git status && [[ -z "$(git status -s)" ]]

pre-checks-python:
name: "Pre-checks: Node python lint"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Run pre-checks
run: |
pip install -r code-requirements.txt
isort -c --profile black nucliadb_sidecar
cd nucliadb_sidecar
flake8 src/nucliadb_sidecar --config=setup.cfg
black --check .

mypy-check:
name: "Pre-checks: Node mypy"
name: "Pre-checks: Python lint"
runs-on: ubuntu-latest
needs:
- build-virtual-env
Expand All @@ -103,7 +79,13 @@ jobs:
key: venv-${{ github.sha }}
fail-on-cache-miss: true
- name: Run mypy
run: pdm run mypy nucliadb_sidecar
run: |
source .venv/bin/activate
for package in nucliadb nucliadb_utils nucliadb_telemetry nucliadb_sdk nucliadb_dataset nucliadb_models nucliadb_sidecar nucliadb_node_binding nucliadb_performance
do
make -C $package lint || ERROR=1
done
jotare marked this conversation as resolved.
Show resolved Hide resolved
exit $ERROR

licenses:
name: Check Licenses
Expand Down Expand Up @@ -142,6 +124,7 @@ jobs:
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.12"
cache: true
- name: Install venv
run: pdm sync -d
- name: Upload virtualenv to cache
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/nucliadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ concurrency:
cancel-in-progress: true

jobs:
pre-checks:
uses: ./.github/workflows/_component_prechecks.yml
with:
component: "nucliadb"
python_version: "3.12"

# Job to run Python tests
tests:
name: NucliaDBTests
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/nucliadb_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ concurrency:
cancel-in-progress: true

jobs:
pre-checks:
strategy:
matrix:
python-version: ["3.9", "3.12"]
uses: ./.github/workflows/_component_prechecks.yml
with:
python_version: "${{ matrix.python-version }}"
component: "nucliadb_dataset"

# Job to run tests
tests:
name: NucliaDBDatasetTests
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/nucliadb_ingest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,6 @@ env:
TESTING_TIKV_LOCAL: "true"

jobs:
# Job to run pre-checks
pre-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install package
run: make -C nucliadb/ install-dev

- name: Run pre-checks
run: make -C nucliadb/ lint

# Job to run tests
tests:
runs-on: ubuntu-latest
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/nucliadb_models.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/nucliadb_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,39 +69,6 @@ env:
GCP_SERVICE_ACCOUNT: "[email protected]"

jobs:
pre-checks-python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install package
run: make -C nucliadb_sidecar/ install-dev

- name: Run pre-checks
run: make -C nucliadb_sidecar/ lint

licenses:
name: Check Licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
name: cargo deny
with:
log-level: warn
command: check licenses

format-rust:
name: Rust code Format
runs-on: ubuntu-latest
Expand Down Expand Up @@ -168,7 +135,6 @@ jobs:
tests-python:
name: Python tests
runs-on: ubuntu-latest
needs: [pre-checks-python, licenses]

strategy:
matrix:
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/nucliadb_reader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,6 @@ env:
IMAGE_NAME: reader

jobs:
# Job to run pre-checks
pre-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.12']

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install package
run: make -C nucliadb/ install-dev

- name: Run pre-checks
run: make -C nucliadb/ lint-reader

# Job to run tests
tests:
runs-on: ubuntu-latest
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/nucliadb_sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ concurrency:
cancel-in-progress: true

jobs:
pre-checks:
strategy:
matrix:
python-version: ["3.9", "3.12"]
uses: ./.github/workflows/_component_prechecks.yml
with:
python_version: "${{ matrix.python-version }}"
component: "nucliadb_sdk"

# Job to run tests
tests:
name: NucliaDBSDKTests
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/nucliadb_search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,6 @@ env:
GCP_SERVICE_ACCOUNT: "[email protected]"

jobs:
# Job to run pre-checks
pre-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.12']

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install package
run: make -C nucliadb/ install-dev

- name: Run pre-checks
run: make -C nucliadb/ lint-search

# Job to run tests
tests:
runs-on: ubuntu-latest
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/nucliadb_standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,6 @@ permissions:
contents: read # This is required for actions/checkout

jobs:
# Job to run pre-checks
pre-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install package
run: make -C nucliadb/ install-dev

- name: Run pre-checks
run: make -C nucliadb/ lint-standalone

# Job to run tests
tests:
runs-on: ubuntu-latest
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/nucliadb_telemetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ concurrency:
cancel-in-progress: true

jobs:
pre-checks:
strategy:
matrix:
python-version: ["3.9", "3.12"]
uses: ./.github/workflows/_component_prechecks.yml
with:
python_version: "${{ matrix.python-version }}"
component: "nucliadb_telemetry"

# Job to run tests
tests:
name: NucliaDBTelemetryTests
Expand All @@ -53,7 +44,7 @@ jobs:

- name: Run tests
run: |
pytest -rfE --cov=nucliadb_telemetry -s --tb=native -v --cov-report xml --cov-append nucliadb_telemetry/nucliadb_telemetry
pytest -rfE --cov=nucliadb_telemetry -s --tb=native -v --cov-report xml --cov-append nucliadb_telemetry/tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/nucliadb_train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,6 @@ env:
IMAGE_NAME: nucliadb_train

jobs:
# Job to run pre-checks
pre-checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install package
run: make -C nucliadb/ install-dev

- name: Run pre-checks
run: make -C nucliadb/ lint-train

# Job to run tests
tests:
runs-on: ubuntu-latest
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/nucliadb_utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ concurrency:
cancel-in-progress: true

jobs:
# Job to run pre-checks
pre-checks:
strategy:
matrix:
python-version: ["3.9", "3.12"]
uses: ./.github/workflows/_component_prechecks.yml
with:
python_version: "${{ matrix.python-version }}"
component: "nucliadb_utils"

# Job to run tests
tests:
name: NucliaDBUtilsTests
Expand Down
Loading
Loading