Update files from master #625
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
push: | |
paths: | |
- '**.yml' | |
- '**.toml' | |
- '**.ini' | |
- '**.py' | |
- '**.json' | |
- '**.csv' | |
- '**.pkl' | |
- '**.pbz2' | |
pull_request: | |
paths: | |
- '**.yml' | |
- '**.toml' | |
- '**.ini' | |
- '**.py' | |
- '**.json' | |
- '**.csv' | |
- '**.pkl' | |
- '**.pbz2' | |
jobs: | |
check-version: | |
name: Check version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Build changelog | |
run: pip install yaml-changelog>=0.1.7 && make changelog | |
- name: Preview changelog update | |
run: ".github/get-changelog-diff.sh" | |
- name: Check version number has been properly updated | |
run: .github/is-version-number-acceptable.sh | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.11", "3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Miniconda using Python ${{ matrix.python-version }} | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Mambaforge | |
auto-update-conda: true | |
activate-environment: ogcore-dev | |
environment-file: environment.yml | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
- name: Build | |
shell: bash -l {0} | |
run: | | |
pip install -e . | |
- name: Test | |
shell: bash -l {0} | |
working-directory: ./ | |
run: | | |
python -m pytest -m "not local" --cov=./ --cov-report=xml | |
- name: Upload coverage to Codecov | |
if: matrix.os == 'ubuntu-latest' && contains(github.repository, 'PSLmodels/OG-Core') | |
uses: codecov/codecov-action@v4 | |
with: | |
files: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true |