Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing CI #80

Merged
merged 6 commits into from
Mar 8, 2023
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
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
omit =
*/_version.py
*/data/*

[report]
exclude_lines =
if __name__ == "__main__"
pragma: no cover
pragma: no-cover
-no-cov
raise NotImplementedError
77 changes: 22 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,105 +3,72 @@ name: CI
on:
push:
branches:
- "master"
- "dev"
- "main"
pull_request:
branches:
- "master"
- "dev"
- "main"
schedule:
# Run a cron job once daily
- cron: "0 0 * * *"

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

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

jobs:
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
name: "tests"
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
include:
- name: Linux, Python 3.9
os: ubuntu-latest
python-version: "3.9"
conda-installer: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh

- name: MacOS, Python 3.9
os: macOS-latest
python-version: "3.9"
conda-installer: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-x86_64.sh
os: ['ubuntu', 'macos']
python-version:
- "3.9"
- "3.10"
- "3.11"

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
installer-url: ${{ matrix.conda-installer }}
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test
channel-priority: true
environment-file: devtools/conda-envs/env.yaml
auto-activate-base: false
use-mamba: true
miniforge-variant: Mambaforge

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a

- name: Environment Information
shell: bash -l {0}
run: |
conda info --all
conda list
mamba --version

- name: Install package
shell: bash -l {0}
run: |
python -m pip install -e .

- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=cinnabar --cov-report=xml --cov-report=term --color=yes cinnabar/tests/
- uses: codecov/codecov-action@v2

- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

lint-format:
name: Lint & format checks
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
python-version: "3.9"
activate-environment: test
channel-priority: true
environment-file: devtools/conda-envs/env.yaml
auto-activate-base: false
use-mamba: true

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Environment Information
shell: bash -l {0}
run: |
conda info --all
conda list
- name: Install package
shell: bash -l {0}
run: |
python -m pip install --no-deps .
1 change: 0 additions & 1 deletion devtools/conda-envs/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ dependencies:
# testing
- pytest
- pytest-cov
- codecov
- nbval