Skip to content

Commit

Permalink
restore workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
epignatelli committed Dec 20, 2023
1 parent dec8505 commit 0257fe5
Show file tree
Hide file tree
Showing 7 changed files with 307 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: Bug report
description: >-
Report a bug or unexpected behavior to help us improve the package
labels:
- bug

body:
- type: markdown
attributes:
value: >
## A bug found is a bug fixed, thank you for helping with Helx!
* Please first verify that your issue is not already reported using the
[issue search][https://github.com/epignatelli/helx/search?q=is%3Aissue&type=issues].
* If you would like a new feature, please consider
[requesting one](https://github.com/epignatelli/helx/issues/new?template=feature.yml)
* If you would like to ask a question, please consider
[opening a discussion](https://github.com/epignatelli/helx/discussions)
* If you prefer a non-templated issue report, click [here][http://github.com/epignatelli/helx/issues/new].
- type: textarea
attributes:
label: Description
description: >-
A concise description of the bug, preferably including self-contained
code to reproduce the issue.
```
validations:
required: true
- type: input
attributes:
label: What helx version are you using?
placeholder: e.g, helx v0.3.0
- type: textarea
attributes:
label: Python environment
description: >-
If you are using `conda`, what is the output of `conda list`?
If you are using `pip`, what is the output of `pip freeze`?
placeholder: |
<details>
<summary>Python environment</summary>
```
...
```
</details>
- type: input
attributes:
label: Python version
description: >-
What is the output of `python --version`?
placeholder: e.g., Python 3.9.15
- type: input
attributes:
label: OS version
description: >-
What is the output of `cat /etc/os-release`?
placeholder: |
e.g,
````
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
````
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Have questions or want to have a chat?
url: https://github.com/epignatelli/helx/discussions
about: Please ask questions on the Discussions tab
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Feature or improvement request
description: >-
Request a missing feature, or an improvement to an existing feature that is not a bug
labels:
- bug

body:
- type: markdown
attributes:
value: >
## Thank you for helping with Helx!
* Please first verify that your issue is not already reported using the
[issue search][https://github.com/epignatelli/helx/search?q=is%3Aissue&type=issues].
* If something does not work as expected, please consider
[reporting a bug](https://github.com/epignatelli/helx/issues/new?template=bug.yml)
* If you would like to ask a question, please consider
[opening a discussion](https://github.com/epignatelli/helx/discussions)
* If you prefer a non-templated issue report, click [here][http://github.com/epignatelli/helx/issues/new].
- type: textarea
attributes:
label: Description
description: >-
A concise description of what is currently missing in helx,
preferably with the reason of why the missing feature is required.
- type: textarea
attributes:
label: Proposal
description: >-
Please provide a minimal example of how the *usage* of the new, finished API would look like.
placeholder: |
For example, if I'd wish to include a new environment suite, like `gymnax`,
I'd type a use case I'd like to test:
```python
env, env_params = gymnax.make("Pendulum-v1")
env = helx.environment.to_helx(env)
helx.experiment.run(env, helx.agents.Random(env.observation_space, action_space), 10)
````
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
Add the number of the isse this PR closes.
If the PR is not linked to an issue, please open one first,
create a linked branch, and open the pull request from it.
For example:
Closes #123
-->
Closes #

<!--
Add a brief description of what your PR does,
and any information that can improve and speed-up the review process.
For example:
- Add a way to do X
- Fix a bug with Y
-->
58 changes: 58 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CD

on:
workflow_dispatch:
push:
branches:
- "main"

jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get version from file
run: |
HELX_VERSION="$(cat helx/_version.py | grep '__version__ = ' | cut -d'=' -f2 | sed 's,\",,g' | sed "s,\',,g" | sed 's, ,,g')"
echo "Current version is:"
echo "$HELX_VERSION"
echo "HELX_VERSION=$HELX_VERSION" >> $GITHUB_ENV
- name: Create changelog and push tag
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
output-file: false
fallback-version: ${{ env.HELX_VERSION }}
skip-commit: true

- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.HELX_VERSION }}
name: "HELX release v${{ env.HELX_VERSION }}"
body: ${{ steps.changelog.outputs.clean_changelog }}

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install pypa/build
run: |
python -m pip install build
- name: Build wheel and sdist
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
76 changes: 76 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
Test:
runs-on: ${{ matrix.os }}-latest
permissions:
contents: read
packages: write
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
max-parallel: 5
matrix:
os: ["ubuntu"]
continue-on-error: false
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-version: latest
environment-file: environment.yml
activate-environment: helx
auto-activate-base: false
- name: Setup helx
run: |
pip install . -v
- name: Check code quality
run: |
pip install pylint
MESSAGE=$(pylint -ry $(git ls-files '*.py') ||:)
echo "$MESSAGE"
# - name: Run unit tests with pytest
# run: |
# pytest test/
- name: Run examples
run: |
wandb login ${{ secrets.WANDB_API_KEY }}
wandb disabled
for f in examples/*.py; do python $f; done
Compliance:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: PEP8 Compliance
run: |
pip install pylint
PR_BRANCH=${{ github.event.pull_request.target.ref }}
MAIN_BRANCH=origin/${{ github.event.pull_request.base.ref }}
CURRENT_DIFF=$(git diff --name-only --diff-filter=d $MAIN_BRANCH $PR_BRANCH | grep -E '\.py$' | tr '\n' ' ')
if [[ $CURRENT_DIFF == "" ]];
then MESSAGE="Diff is empty and there is nothing to pylint."
else
MESSAGE=$(pylint -ry --disable=E0401 $CURRENT_DIFF ||:)
fi
echo 'MESSAGE<<EOF' >> $GITHUB_ENV
echo "<pre><code>$MESSAGE</code></pre>" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
echo "Printing PR message: $MESSAGE"
- uses: mshick/add-pr-comment@v2
with:
issue: ${{ github.event.pull_request.number }}
message: ${{ env.MESSAGE }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Triage

on:
issues:
types: [opened]
pull_request:
types: [opened]

jobs:
assign-project:
runs-on: ubuntu-latest
permissions:
contents: write
repository-projects: write
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/users/epignatelli/projects/7
github-token: ${{ secrets.TRIAGE_KEY }}
assign-assignee:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions-ecosystem/action-add-assignees@v1
with:
github_token: ${{ secrets.TRIAGE_KEY }}
assignees: ${{ github.actor }}

0 comments on commit 0257fe5

Please sign in to comment.