Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/workflows/build-and-test-mlbstatsapi-prd.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/build-and-test-mlbstatsapi-test.yml

This file was deleted.

54 changes: 46 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
name: Python Build MLBstats API
name: Offline CI

on:
pull_request:
branches:
- main
- release/0.8.0
push:
branches-ignore:
- 'main'
- 'development'
branches:
- main
- release/0.8.0
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
offline-tests:
name: Offline tests - Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version:
- "3.10"
- "3.11"
- "3.12"

steps:
- uses: actions/checkout@v4
Expand All @@ -26,7 +42,29 @@ jobs:
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction
- name: Test external tests with pytest
run: poetry run pytest tests/external_tests/
- name: Run offline tests
run: |
poetry run pytest \
tests/ \
--ignore=tests/external_tests

build-package:
name: Build package
needs: offline-tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction
- name: Build package
run: poetry build
34 changes: 34 additions & 0 deletions .github/workflows/external-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: External MLB API Tests

on:
workflow_dispatch:
schedule:
- cron: "0 12 * * 1"

permissions:
contents: read

jobs:
external-tests:
name: External MLB API tests - Python 3.12
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction
- name: Run external MLB API tests
run: |
poetry run pytest \
tests/external_tests/ \
-v
Loading
Loading