Skip to content

CI

CI #739

Workflow file for this run

name: CI
on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# The cookiecutter uses the "--initial-branch" flag when it runs git-init
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
# Weekly tests run on main by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * 0"
jobs:
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [macOS-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- name: Setup Micromamba and install from environment
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.5.6-0'
micromamba-binary-path: ~/.local/bin/micromamba
environment-file: environment.yml
environment-name: batter_dev
cache-environment: true
cache-downloads: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ matrix.python-version }}
init-shell: bash
- name: Install deps from main environment file
shell: bash -l {0}
run: |
micromamba run -n batter_dev pip install -e ./extern/alchemlyb
micromamba run -n batter_dev pip install -e ./extern/rocklinc
micromamba run -n batter_dev pip install -e .
- name: List installed packages
shell: bash -l {0}
run: |
micromamba list
- name: Run tests
# conda setup requires this special shell
shell: bash -l {0}
run: |
BATTER_TEST_RUN_CLI=1 pytest -v --cov=batter --cov-report=xml --color=yes tests/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}