Skip to content

Commit

Permalink
refactor workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Jun 24, 2024
1 parent 83ab7a7 commit b15baac
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 28 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/check-lint.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
#
# This workflow will...
# - see: https://docs.astral.sh/ruff/integrations/#github-actions

name: Linting via ruff (check)

name: Linting via ruff

on:
push:
branches: [ "master", "stable" ]
paths: ["src/**.py", "tests/**"]
paths: ["src/**.py", "tests/**", ".github/workflows/check-lint.yml"]

pull_request:
branches: [ "master", "stable" ]
paths: ["src/**.py", "tests/**"]
paths: ["src/**.py", "tests/**", ".github/workflows/check-lint.yml"]

workflow_dispatch:


jobs:
lint: # name of job
lint:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
Expand All @@ -28,15 +33,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install core dependencies & ruff
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Format via ruff
run: ruff format .
pip install -r requirements.txt
pip install ruff
- name: Check via ruff
- name: Check with ruff
run: ruff check --output-format=github .

- run: echo "🍏 This job's status is ${{ job.status }}."
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
#
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# - see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Testing via pytest


on:
push:
branches: [ "master", "stable" ]
paths: ["src/**.py", "tests/**"]
paths: ["src/**.py", "tests/**", ".github/workflows/check-test.yml"]

pull_request:
branches: [ "master", "stable" ]
paths: ["src/**.py", "tests/**"]
paths: ["src/**.py", "tests/**", ".github/workflows/check-test.yml"]

workflow_dispatch:


jobs:
test: # name of job
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
Expand All @@ -28,15 +33,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install core dependencies & pytest
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
pip install -r requirements.txt
pip install pytest pytest-asyncio
- name: Test non-RF via pytest
run: pytest -v tests/tests # --log-cli-level=WARNING
- name: Install the package
run: pip install -e .

- name: Test virtual RF via pytest
run: pytest -v tests/tests_rf # --log-cli-level=WARNING
- name: Test with pytest
run: pytest -v

- run: echo "🍏 This job's status is ${{ job.status }}."
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
#
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# - see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Typing via mypy


on:
push:
branches: [ "master", "stable" ]
paths: ["src/**.py", "tests/**.py", "src/**/py.typed"]
paths: ["src/**.py", "tests/**.py", "src/**/py.typed", ".github/workflows/type-type.yml"]

pull_request:
branches: [ "master", "stable" ]
paths: ["src/**.py", "tests/**.py", "src/**/py.typed"]
paths: ["src/**.py", "tests/**.py", "src/**/py.typed", ".github/workflows/type-type.yml"]

workflow_dispatch:


jobs:
type: # name of job
lint:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
Expand All @@ -28,12 +33,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install CLI dependencies & mypy
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_dev.txt
- name: Check via mypy
run: mypy --config-file pyproject.toml
- name: Check with mypy
run: mypy

- run: echo "🍏 This job's status is ${{ job.status }}."

0 comments on commit b15baac

Please sign in to comment.