forked from foua-pps/level1c4pps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for github-ci and add admin for standard releasing proced…
…ures Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
- Loading branch information
Adam.Dybbroe
committed
May 19, 2021
1 parent
4447837
commit 0eeb23e
Showing
9 changed files
with
218 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#### Code Sample, a minimal, complete, and verifiable piece of code | ||
|
||
```python | ||
# Your code here | ||
|
||
``` | ||
#### Problem description | ||
|
||
[this should also explain **why** the current behaviour is a problem and why the | ||
expected output is a better solution.] | ||
|
||
#### Expected Output | ||
|
||
#### Actual Result, Traceback if applicable | ||
|
||
#### Versions of Python, package at hand and relevant dependencies | ||
|
||
|
||
Thank you for reporting an issue ! |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- Describe what your PR does, and why --> | ||
|
||
- [ ] Closes #xxxx <!-- remove if there is no corresponding issue, which should only be the case for minor changes --> | ||
- [ ] Tests added <!-- for all bug fixes or enhancements --> | ||
- [ ] Tests passed: Passes ``pytest pyspectral`` <!-- for all non-documentation changes) --> | ||
- [ ] Passes ``flake8`` <!-- remove if you did not edit any Python files --> | ||
- [ ] Fully documented <!-- remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later --> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest"] | ||
python-version: ["3.7", "3.8", "3.9"] | ||
experimental: [false] | ||
include: | ||
- python-version: "3.9" | ||
os: "ubuntu-latest" | ||
experimental: true | ||
|
||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
OS: ${{ matrix.os }} | ||
UNSTABLE: ${{ matrix.experimental }} | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Conda Environment | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "latest" | ||
python-version: ${{ matrix.python-version }} | ||
mamba-version: "*" | ||
channels: conda-forge,defaults | ||
environment-file: continuous_integration/environment.yaml | ||
activate-environment: test-environment | ||
|
||
- name: Install unstable dependencies | ||
if: matrix.experimental == true | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install \ | ||
-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com \ | ||
--no-deps --pre --upgrade \ | ||
dask \ | ||
numpy \ | ||
xarray \ | ||
h5netcdf; \ | ||
python -m pip install \ | ||
--no-deps --upgrade \ | ||
git+https://github.com/pytroll/pyspectral \ | ||
git+https://github.com/pytroll/trollsift \ | ||
git+https://github.com/pytroll/satpy \ | ||
git+https://github.com/pytroll/pyorbital; | ||
- name: Install level1c4pps | ||
shell: bash -l {0} | ||
run: | | ||
pip install --no-deps -e . | ||
- name: Run unit tests | ||
shell: bash -l {0} | ||
run: | | ||
pytest --cov=level1c4pps level1c4pps/tests --cov-report=xml --cov-report= | ||
- name: Upload unittest coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
flags: unittests | ||
file: ./coverage.xml | ||
env_vars: OS,PYTHON_VERSION,UNSTABLE | ||
fail_ci_if_error: false | ||
|
||
- name: Coveralls Parallel | ||
uses: AndreMiras/coveralls-python-action@develop | ||
with: | ||
flag-name: run-${{ matrix.test_number }} | ||
parallel: true | ||
if: runner.os == 'Linux' | ||
|
||
coveralls: | ||
needs: [test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: AndreMiras/coveralls-python-action@develop | ||
with: | ||
parallel-finished: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Deploy sdist | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Create sdist | ||
shell: bash -l {0} | ||
run: python setup.py sdist | ||
|
||
- name: Publish package to PyPI | ||
if: github.event.action == 'published' | ||
uses: pypa/gh-action-pypi-publish@v1.4.1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## Version <v0.2.2> (2021/05/19) | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Releasing activefires-pp | ||
|
||
prerequisites: `pip install setuptools twine` | ||
|
||
|
||
1. checkout main | ||
2. pull from repo | ||
3. run the unittests | ||
4. run `loghub` and update the `CHANGELOG.md` file: | ||
|
||
``` | ||
loghub foua-pps/level1c4pps --token <personal access token (see https://github.com/settings/tokens)> -st v<previous version> -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes" | ||
``` | ||
|
||
Don't forget to commit! | ||
|
||
5. Create a tag with the new version number, starting with a 'v', eg: | ||
|
||
``` | ||
git tag -a v0.1.1 -m "Version 0.1.1" | ||
``` | ||
|
||
See [semver.org](http://semver.org/) on how to write a version number. | ||
|
||
|
||
6. push changes to github `git push --follow-tags` | ||
|
||
7. Verify the Github actions unit tests passed | ||
|
||
8. Create a "Release" on GitHub by going to | ||
https://github.com/adybbroe/activefires-pp/releases and clicking "Draft a new | ||
release". On the next page enter the newly created tag in the "Tag version" | ||
field, "Version X.Y.Z" in the "Release title" field, and paste the markdown | ||
from the changelog (the portion under the version section header) in the | ||
"Describe this release" box. Finally click "Publish release". | ||
|
||
9. Verify the GitHub actions for deployment succeed and the release is on PyPI |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: test-environment | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- distributed | ||
- toolz | ||
- sphinx | ||
- dask | ||
- pyyaml | ||
- pyproj | ||
- coveralls | ||
- coverage | ||
- codecov | ||
- behave | ||
- mock | ||
- numpy | ||
- xarray | ||
- satpy | ||
- pyspectral | ||
- h5netcdf | ||
- pyorbital | ||
- pytest | ||
- pytest-cov | ||
- pip | ||
- pip: | ||
- trollsift |
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