Skip to content

Commit

Permalink
BUG: fixes for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
beardymcjohnface committed Jul 8, 2024
1 parent 0d7f370 commit 57e6dda
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 11 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Codecov

on:
push:
branches: [ "main" ]
paths:
- '.github/**'
- 'build/**'
- 'tests/**'
- '{{cookiecutter.project_slug}}/**'
pull_request:
branches: [ "main" ]
paths:
- '.github/**'
- 'build/**'
- 'tests/**'
- '{{cookiecutter.project_slug}}/**'

permissions:
contents: read

jobs:
tests:
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -el {0}

strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]

steps:
- uses: "actions/checkout@v3"
with:
fetch-depth: 0

# Setup env
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
mamba-version: "*"
channel-priority: strict
activate-environment: nektool
environment-file: build/environment.yaml
python-version: ${{ matrix.python-version }}
auto-activate-base: false

- name: "Setup Nektool on ${{ matrix.os }} for Python ${{ matrix.python-version }}"
run: |
cookiecutter --no-input ./
cd my_nektool/
python -m pip install --upgrade pip
pip install .
- name: "Generate coverage report on ${{ matrix.os }} for Python ${{ matrix.python-version }}"
run: |
pip install pytest pytest-cov
pytest --cov=./ --cov-report=xml --cov-append
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: true
21 changes: 10 additions & 11 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permissions:

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

defaults:
Expand All @@ -33,17 +33,23 @@ jobs:

strategy:
matrix:
os: [macos-12, ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
os: [macos-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: "actions/checkout@v3"
with:
fetch-depth: 0

# Setup env
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
mamba-version: "*"
channel-priority: strict
activate-environment: nektool
environment-file: build/environment.yaml
python-version: ${{ matrix.python-version }}
Expand All @@ -60,10 +66,3 @@ jobs:
run: |
pip install pytest pytest-cov
pytest --cov=./ --cov-report=xml --cov-append
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: true

0 comments on commit 57e6dda

Please sign in to comment.