Skip to content

Commit

Permalink
Split CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoOinonen committed Nov 24, 2023
1 parent be5ec62 commit 0cb4b44
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml → .github/workflows/ci_pr.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@

name: Python CI
on: [push, pull_request]
name: CI on PR
on: pull_request

jobs:
run-tests:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11'] # Add 3.12 when pytorch has a wheel

steps:

Expand All @@ -18,21 +15,17 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: 3.11

- name: Install package
run: |
bash ./build.sh
pip install -e .[dev]
- name: Lint with flake8
run: flake8 .

- name: Run pytest
run: pytest --junitxml=pytest.xml --cov-report=term-missing --cov=mlspm tests | tee pytest-coverage.txt
run: pytest --junitxml=pytest.xml --cov-report=term-missing --cov | tee pytest-coverage.txt

- name: Pytest coverage comment
if: ${{ github.event_name == 'pull_request' && matrix.python-version == '3.11' }}
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/ci_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

name: CI on push
on: push

jobs:
run-tests:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11'] # Add 3.12 when pytorch has a wheel

steps:

- name: Checkout repository
uses: actions/checkout@v4

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

- name: Install package
run: |
bash ./build.sh
pip install -e .[dev]
- name: Lint with flake8
run: flake8 .

- name: Run pytest
run: pytest

0 comments on commit 0cb4b44

Please sign in to comment.