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

[Do Not Merge] Update workflows #2163

Closed
34 changes: 34 additions & 0 deletions .github/workflows/pre_merge_code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Pre-Merge Checks
permissions: read-all

on:
workflow_call: # call from pre-merge tests
workflow_dispatch: # run on request (no need for PR)

# This is what will cancel the workflow concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Code-Quality-Checks:
runs-on: ubuntu-20.04
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Tox
run: pip install tox
- name: Code quality checks
run: tox -e pre-commit

md-dead-link-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: AlexanderDokuchaev/md-dead-link-check@v0.8
with:
config: pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pre-Merge Checks
name: Pre-Merge Tests
permissions: read-all

on:
Expand All @@ -10,6 +10,10 @@ on:
- reopened
- synchronize
- ready_for_review
paths:
- "**.py"
- "**.ipynb"
- "**.yaml"
workflow_dispatch: # run on request (no need for PR)

# This is what will cancel the workflow concurrency
Expand All @@ -18,22 +22,11 @@ concurrency:
cancel-in-progress: true

jobs:
Code-Quality-Checks:
runs-on: ubuntu-20.04
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Tox
run: pip install tox
- name: Code quality checks
run: tox -e pre-commit
Pre-Merge-Checks:
uses: ./.github/workflows/pre_merge_code_quality.yml
Pre-Merge-Tests:
runs-on: [self-hosted, linux, x64, anomalib]
needs: Code-Quality-Checks
needs: [Pre-Merge-Checks]
if: github.event.pull_request.draft == false
strategy:
max-parallel: 1
Expand Down Expand Up @@ -76,11 +69,3 @@ jobs:
else
./codecov -t "${CODECOV_TOKEN}" --sha $COMMIT_ID -U $HTTP_PROXY -f .tox/coverage.xml
fi

md-dead-link-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: AlexanderDokuchaev/md-dead-link-check@v0.8
with:
config: pyproject.toml
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:

# notebooks.
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
rev: 1.8.5
hooks:
- id: nbqa-ruff
# Ignore unsorted imports. This is because jupyter notebooks can import
Expand Down
Loading