From 8ca3f8b6d23a9193e55a197bd69bf325df0b7c25 Mon Sep 17 00:00:00 2001 From: Pratik Borole Date: Sat, 27 Jan 2024 11:35:12 +0530 Subject: [PATCH] ci: added linting and workflow dependencies --- .github/workflows/ci.yml | 5 +++++ .github/workflows/tests.yml | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e00fe7..f210090 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: Build and Publish Docker Images on: + workflow_run: + workflows: [Run Tests, CodeQL] + types: [completed] push: branches: [main, staging, dev] pull_request: @@ -16,6 +19,8 @@ jobs: build: name: Build runs-on: ubuntu-latest + # run only if workflow dependencies succeed + if: ${{ github.event.workflow_run.conclusion == 'success' }} permissions: contents: read packages: write diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb7dda0..f205f0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,15 +8,25 @@ on: jobs: test: - name: 📊 PyTest + name: 🔬 Linting, 📊 PyTest runs-on: ubuntu-latest steps: - name: ⬇️ Checkout repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: 🔬 Python Lint (isort/black) + run: | + isort --version-number + isort --check-only --quiet + black --version + black --check . + - name: Install poetry run: pipx install poetry + - name: View poetry version + run: poetry --version + - name: 🐍 Set up Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c with: