Skip to content

Commit

Permalink
ci: use reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Nov 5, 2023
1 parent 78390f6 commit e2aabe9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 42 deletions.
50 changes: 9 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- run: pip install check-manifest && check-manifest
- run: pipx run check-manifest

test:
name: ${{ matrix.platform }} (${{ matrix.python-version }})
runs-on: ${{ matrix.platform }}
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
pip-install-flags: ${{ github.event_name == 'schedule' && '--pre' || '' }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
platform: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.10", "3.11", "3.12"]
include:
- python-version: "3.12"
- python-version: "3.9"
platform: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -e .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }}
- name: Test
run: pytest -v --cov=in_n_out --cov-report=xml --color=yes

# If something goes wrong, we can open an issue in the repo
- name: Report --pre Failures
if: failure() && github.event_name == 'schedule'
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLATFORM: ${{ matrix.platform }}
PYTHON: ${{ matrix.python-version }}
RUN_ID: ${{ github.run_id }}
TITLE: "[test-bot] pip install --pre is failing"
with:
filename: .github/TEST_FAIL_TEMPLATE.md
update_existing: true

- name: Coverage
uses: codecov/codecov-action@v3

test_app_model:
name: app-model
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ testpaths = ["tests"]
filterwarnings = ["error"]

[tool.coverage.run]
source = ['src/in_n_out']
source = ['in_n_out']
command_line = "-m pytest"

# https://coverage.readthedocs.io/en/6.4/config.html
Expand All @@ -114,6 +114,7 @@ exclude_lines = [
]
show_missing = true


# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = "src/**/*.py"
Expand Down

0 comments on commit e2aabe9

Please sign in to comment.