Skip to content

Address Issue 33

Address Issue 33 #611

Workflow file for this run

name: CI
on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
push:
branches:
- "*"
- "**"
pull_request:
branches:
- "master"
- "develop"
schedule:
# Nightly tests run on master 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 * * *"
jobs:
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
condarc: |
channels:
- conda-forge
create-args: >-
python=${{ matrix.python-version }}
- name: Testing Dependencies
shell: bash -l {0}
run: |
python -m pip install -U pytest pytest-cov codecov
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps -vvv
conda list
- name: Run tests
shell: bash -l {0}
run: |
ls -a despasito/equations_of_state/saft/compiled_modules
pytest -vvv --cov=despasito --cov-report=xml --color=yes despasito/tests/
- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
- name: Flake8
shell: bash -l {0}
run: |
python -m flake8 despasito --count --ignore=E741,W503 --max-line-length=92 --show-source --statistics
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
paper-path: paper/paper.md
- name: Upload
uses: actions/upload-artifact@v3
with:
name: paper
path: paper/paper.pdf
# - name: Commit PDF to repository
# uses: EndBug/add-and-commit@v9
# with:
# message: '(auto) Paper PDF Draft'
# add: 'paper/*.pdf'