-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from maxfordham/195-add-github-action-workflo…
…w-for-unit-tests ✨ Add workflow and issue templates
- Loading branch information
Showing
33 changed files
with
188 additions
and
360 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "\U0001F41B " | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: "✨ " | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,20 @@ | ||
--- | ||
name: Refactoring / maintenance | ||
about: Updates and improvements | ||
title: "♻️ " | ||
labels: enhancement | ||
assignees: '' | ||
--- | ||
|
||
**Describe the upkeep / improvement you'd like to see** | ||
A clear and concise description of what the bug is. | ||
|
||
**What aspect of the repo is it likely to impact?** | ||
|
||
**How urgent?** | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,82 @@ | ||
name: Test Python Package (Cached Conda Environment) | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
env: | ||
CACHE_NUMBER: 0 # increase to reset cache manually | ||
|
||
jobs: | ||
build: | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
label: linux-64 | ||
prefix: /usr/share/miniconda3/envs/my-env | ||
|
||
# Add macOS and Windows builds here if you need them | ||
# - os: macos-latest | ||
# label: osx-64 | ||
# prefix: /Users/runner/miniconda3/envs/my-env | ||
|
||
# - os: windows-latest | ||
# label: win-64 | ||
# prefix: C:\Miniconda3\envs\my-env | ||
|
||
name: ${{ matrix.label }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Mambaforge | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
activate-environment: my-env | ||
use-mamba: true | ||
|
||
- name: Set cache date | ||
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ matrix.prefix }} | ||
key: ${{ matrix.label }}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} | ||
id: cache | ||
|
||
- name: Update environment | ||
run: mamba env update -n my-env -f environment.yml | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
|
||
- name: Install flake8 | ||
run: | | ||
conda install -n my-env flake8 | ||
- name: Lint with flake8 | ||
shell: bash -l {0} | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
# Ignore scripts folder as mainly archived scripts | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Install pytest | ||
run: | | ||
conda install -n my-env pytest | ||
- name: Run tests | ||
shell: bash -l {0} | ||
run: pytest ./tests |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
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
Oops, something went wrong.