Skip to content

Commit

Permalink
dev: pytest and coverage (#3)
Browse files Browse the repository at this point in the history
* dev: pytest and coverage

* dev: updating workflow

* dev: forgot a comma

* dev: fixing dependencies
  • Loading branch information
eckelsjd authored Dec 7, 2023
1 parent 4916118 commit 25eddbf
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build docs
name: docs
on:
push:
branches:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: tests
on:
pull_request:
branches: [ main ]
permissions:
contents: write
jobs:
Testing:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, macOS-latest, windows-latest ]

steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pdm install
- name: Run tests
run: |
pdm run -v test
- name: Coveralls
uses: coverallsapp/github-action@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .idea/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 39 additions & 11 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,45 @@ We use [Github](https://guides.github.com/introduction/flow/index.html) to host
## Submitting pull requests
Pull requests are the best way to propose changes to the codebase (bug fixes, new features, docs, etc.)

1. Fork the repo and create your branch from `main`. Follow the general branch naming convention of `username-type-issue#` (e.g. `eckelsjd-bugfix-1`).
If you are adding a feature or making major changes, first create the [issue](https://github.com/eckelsjd/amisc/issues). "Type" is something like `bugfix` or `feature`.
2. If you've added code that should be tested, add a [test](https://github.com/eckelsjd/amisc/tests).
3. If you've made major changes, update the [documentation](https://github.com/eckelsjd/amisc/docs).
4. Ensure the test suite passes (coming soon).
5. Make sure your code lints (coming soon).
6. Issue that pull request!
1. Fork the repo and create your branch from `main`.
3. If you are adding a feature or making major changes, first create the [issue](https://github.com/eckelsjd/amisc/issues).
4. If you've added code that should be tested, add a [test](https://github.com/eckelsjd/amisc/tests).
5. If you've made major changes, update the [documentation](https://github.com/eckelsjd/amisc/docs).
6. Ensure the test suite passes (`pdm run test`).
7. Make sure your code passes lint checks (coming soon).
8. Follow [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines when adding a commit message.
9. Issue that pull request!

We strongly recommend using [pdm](https://github.com/pdm-project/pdm) to set up your development environment. See the link for install details.
An example contribution workflow is shown here:
We strongly recommend using [pdm](https://github.com/pdm-project/pdm) to set up your development environment. An example contribution workflow is shown here:

```shell
coming soon
pip install --user pdm
# Fork the repo on Github
git clone https://github.com/<your-user-name>/amisc.git
cd amisc
pdm install # Installs all dev and package dependencies (including amisc itself in -e mode) into local .venv
git checkout -b <your-branch-name>
# Make local changes
pdm run test # make sure tests pass
git add -A
git commit -m "Adding a bugfix or new feature"
git push -u origin <your-branch-name>
# Go to Github and "Compare & Pull Request" on your fork
# For your PR to be merged:
# squash all your commits on your branch (interactively in an IDE most likely)
# rebase to the top of origin/main to include new changes from others
git fetch
git rebase -i main your-branch # for example
# Resolve any conflicts
# Your history now looks something like this:
# o your-branch
# /
# ---o---o---o main
# You can delete the branch and fork when your PR has been merged
```

You can also find a good tutorial [here](https://github.com/firstcontributions/first-contributions/tree/main).

## Report bugs using [issues](https://github.com/eckelsjd/amisc/issues)
Open a new issue and describe your problem using the template. Provide screenshots where possible and example log files.
Add labels to help categorize and describe your issue.
Expand All @@ -36,4 +60,8 @@ Add labels to help categorize and describe your issue.
Start or take part in community [discussions](https://github.com/eckelsjd/amisc/discussions) for non-code related things.

## License
By contributing, you agree that your contributions will be licensed under its GNU GPLv3 License.
By contributing, you agree that your contributions will be licensed under its GNU GPLv3 License.

## Releases
The package version is tracked at `amisc.__init__.__version__`. You should not edit this value. Maintainers
will decide when to make a release by bumping this and running `pdm run release`.
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
![Logo](https://raw.githubusercontent.com/eckelsjd/amisc/main/docs/assets/amisc_logo_text.svg)
[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm-project.org)
[![PyPI](https://img.shields.io/pypi/v/amisc?logo=python&logoColor=%23cccccc)](https://pypi.org/project/amisc)
[![Python 3.7](https://img.shields.io/badge/python-3.7+-blue.svg?logo=python&logoColor=cccccc)](https://www.python.org/downloads/)
![Commits](https://img.shields.io/github/commit-activity/m/eckelsjd/amisc?logo=github)
![build](https://img.shields.io/github/actions/workflow/status/eckelsjd/amisc/deploy.yml?logo=github
)
![docs](https://img.shields.io/github/actions/workflow/status/eckelsjd/amisc/docs.yml?logo=materialformkdocs&logoColor=%2523cccccc&label=docs)
![tests](https://img.shields.io/github/actions/workflow/status/eckelsjd/amisc/tests.yml?logo=github&logoColor=%2523cccccc&label=tests)
[![Coverage Status](https://coveralls.io/repos/github/eckelsjd/amisc/badge.svg?branch=main)](https://coveralls.io/github/eckelsjd/amisc?branch=main)
[![Algorithm description](https://img.shields.io/badge/DOI-10.1002/nme.6958-blue)](https://doi.org/10.1002/nme.6958)

Efficient framework for building surrogates of multidisciplinary systems.
Expand Down
118 changes: 72 additions & 46 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 25eddbf

Please sign in to comment.