Skip to content

Commit

Permalink
Add build and test workflow with linting and testing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
m7142yosuke committed Dec 16, 2024
1 parent 2f46b8e commit 95e9864
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Test

on:
push:
branches:
- main
pull_request:

jobs:
lint:
name: Build and Test
runs-on: ubuntu-latest

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

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest

- name: Install dependencies
run: |
poetry install --with dev --with test
- name: Run Tests
run: |
poetry run pytest
7 changes: 0 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,31 @@ jobs:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Setup Python
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

# Install Poetry
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest

# Install dependencies
- name: Install dependencies
run: |
poetry install --with dev
# Run Ruff for linting
- name: Run Ruff
run: |
poetry run ruff check .
# Run Black for code formatting
- name: Run Black
run: |
poetry run black --check .
# Run Mypy for type checking
- name: Run Mypy
run: |
poetry run mypy .

0 comments on commit 95e9864

Please sign in to comment.