Skip to content

Commit

Permalink
Update markdown_format.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bafaurazan authored Dec 27, 2023
1 parent 288ef63 commit 385a133
Showing 1 changed file with 44 additions and 56 deletions.
100 changes: 44 additions & 56 deletions .github/workflows/markdown_format.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,55 @@
name: formatting check

---
####################
####################
## Auto Formatter ##
####################
####################
name: Formate Code

#
# Documentation:
# https://github.com/mezgoodle/auto-formatter
#

#############################
# Start the job on all push #
#############################
on:
workflow_dispatch:
pull_request:
paths:
- "*/**"
push:
paths:
- "*/**"
workflow_run:
workflows: ["Dependabot PR Check"]
types:
- completed

permissions:
contents: read
pull_request:
paths:
- "*/**"
# Remove the line above to run when pull-requesting to master

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Formate Code
# Set the agent to run on
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.7"]

defaults:
run:
working-directory: discord_bot

##################
# Load all steps #
##################
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
with:
sparse-checkout: "discord_bot"
sparse-checkout-cone-mode: false

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

- name: 📜 Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}

- name: 🚀 Cache the venv based on the .lock
uses: actions/cache@v3
with:
path: discord_bot/.venv
key: venv-${{ hashFiles('discord_bot/poetry.lock') }}

- name: 🔨 Install dev dependencies
run: poetry install --with dev

- name: 🧑‍🔧 Lint with ruff
run: poetry run ruff check .

- name: 🧹 Format with black
run: poetry run black --check .

- name: Auto-Formatter
uses: mezgoodle/[email protected]

- name: 🧪 Run tests
run: poetry run pytest
# Full git history is needed to get a proper list of changed files within `auto-formatter`
fetch-depth: 0

################################
# Run Auto-formatter against code base #
################################
- name: Auto-Formatter
uses: mezgoodle/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

0 comments on commit 385a133

Please sign in to comment.