Skip to content

Commit

Permalink
refactor workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
  • Loading branch information
ashwinvaidya17 committed Jul 1, 2024
1 parent da82e72 commit c6993a9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 22 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/pre_merge_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Pre-Merge Checks
permissions: read-all

on:
push:
branches: [main]
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
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,19 +22,6 @@ 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:
runs-on: [self-hosted, linux, x64, anomalib]
needs: Code-Quality-Checks
Expand Down Expand Up @@ -76,11 +67,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

0 comments on commit c6993a9

Please sign in to comment.