Skip to content

Commit

Permalink
Merge pull request hifis-net#47 from Normo/add-ci-workflow
Browse files Browse the repository at this point in the history
ci: add CI/CD workflow
  • Loading branch information
Normo authored Nov 27, 2023
2 parents f0eed81 + 1b48a7a commit 8df29ce
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI
on:
pull_request:
push:
branches:
- "main"
tags:
- "v*.*.*"
schedule:
- cron: "0 0 * * *"
env:
PY_COLORS: 1

jobs:

lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- name: Check out the codebase.
uses: actions/checkout@v4

- name: Prepare the job environment.
uses: ./.github/workflows/prepare-action

- name: Lint code.
run: |
poetry run isort --check --diff .
poetry run black --check --diff .
19 changes: 19 additions & 0 deletions .github/workflows/prepare-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Install dependencies and prepare the environment.
description: Install the necessary dependencies for jobs.
runs:
using: composite
steps:
- name: Install poetry.
run: pipx install poetry
shell: bash

- name: Set up Python 3.
uses: actions/setup-python@v4
id: setup-python
with:
python-version: '3.12'
cache: 'poetry'

- name: Install dependencies via poetry.
run: poetry install
shell: bash
19 changes: 18 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ ipdb = "^0.13.13"

[tool.poetry.dev-dependencies]
black = "^23.11.0"
isort = "^5.12.0"

0 comments on commit 8df29ce

Please sign in to comment.