Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanahiro committed Dec 10, 2023
1 parent 3cbbde7 commit 7871dfe
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint

on:
pull_request:
push:
branches: [main]

jobs:
Test:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: python -m pip install poetry

- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'poetry'

- name: Install dependencies
run: poetry install

- name: Check poetry.lock
run: poetry lock --check

# - name: Type-check with Pyright
# run: poetry run pyright .

- name: Lint with ruff
run: poetry run ruff --output-format=github .

- name: Format with ruff
run: poetry run ruff format .
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on: [push]

jobs:
Test:
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [Ubuntu]
python-version: ['3.11', '3.9']
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4

- name: Install poetry
run: python -m pip install poetry

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

- name: Install dependencies
run: poetry install

- name: Run pytest
run: poetry run pytest -v --cov --cov-report xml --cov-report term

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
#token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
fail_ci_if_error: true

0 comments on commit 7871dfe

Please sign in to comment.