Skip to content

Commit

Permalink
Run all pre-checks in a single job
Browse files Browse the repository at this point in the history
  • Loading branch information
javitonino committed Jun 6, 2024
1 parent 7805700 commit b195d9f
Show file tree
Hide file tree
Showing 45 changed files with 51 additions and 548 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/_component_prechecks.yml

This file was deleted.

34 changes: 8 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
exit $ERROR
licenses:
name: Check Licenses
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
9 changes: 0 additions & 9 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 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

0 comments on commit b195d9f

Please sign in to comment.