Skip to content

Commit

Permalink
Improve workflow readability
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLua authored Dec 3, 2024
1 parent dbe8fc2 commit 9b85973
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 37 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,37 @@ on:
- '.github/workflows/ci.yml'

jobs:
build:
lint:
name: Lint
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip pylint black mypy
pip install -r requirements.txt
- name: Analysing the code with pylint
- name: Run Pylint
run: |
pylint $(git ls-files '*.py')
- name: Format the code with black
- name: Run Black
run: |
black $(git ls-files '*.py') --check
- name: Type checking with mypy
- name: Run Mypy
run: |
mypy $(git ls-files '*.py')
30 changes: 9 additions & 21 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable
# packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency review'
name: Dependency Review

on:
pull_request:
branches: [ "main" ]
branches:
- 'main'

# If using a dependency submission action in this workflow this permission will need to be set to:
#
# permissions:
# contents: write
#
# https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api
permissions:
contents: read
# Write permissions for pull-requests are required for using the `comment-summary-in-pr` option, comment out if you aren't using this option
pull-requests: write

jobs:
dependency-review:
name: Review Dependencies
runs-on: ubuntu-latest

steps:
- name: 'Checkout repository'
- name: Checkout repository
uses: actions/checkout@v4
- name: 'Dependency Review'

- name: Run dependency review
uses: actions/dependency-review-action@v4
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
with:
comment-summary-in-pr: always
deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ permissions:

jobs:
release-build:
name: >-
Build and upload release distributions
name: Build and upload release distributions
runs-on: ubuntu-latest

steps:
Expand All @@ -36,9 +34,7 @@ jobs:
path: dist/

pypi-publish:
name: >-
Publish to PyPI
name: Publish to PyPI
runs-on: ubuntu-latest

needs:
Expand All @@ -48,7 +44,7 @@ jobs:
id-token: write

environment:
name: pypi
name: PyPI
url: https://pypi.org/p/instawebhooks

steps:
Expand All @@ -62,9 +58,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1

testpypi-publish:
name: >-
Publish to TestPyPI
name: Publish to TestPyPI
runs-on: ubuntu-latest

needs:
Expand All @@ -74,7 +68,7 @@ jobs:
id-token: write

environment:
name: testpypi
name: TestPyPI
url: https://test.pypi.org/p/instawebhooks

steps:
Expand Down

0 comments on commit 9b85973

Please sign in to comment.