Skip to content

Commit

Permalink
feat: add initial features
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The first few features include a loader, parser, and plotting capabilities.
  • Loading branch information
alxdrcirilo committed Jul 5, 2024
1 parent a82d438 commit 9526224
Show file tree
Hide file tree
Showing 68 changed files with 4,306 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug report
about: Create a report to help us improve
title: "[bug]"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots (optional)**
If applicable, add screenshots to help explain your problem.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
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: "[feat]"
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.

**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.
46 changes: 46 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Coverage

on:
workflow_run:
workflows: ["Commit lint, format, and release"]
types:
- completed

permissions:
contents: read

jobs:
coveralls:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: poetry install --no-interaction

- name: Run tests with coverage
run: |
source .venv/bin/activate
pytest --cov=apple_health_parser
coverage lcov
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2.1.0
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
file: coverage.lcov
53 changes: 53 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish documentation

on:
workflow_run:
workflows: ["Commit lint, format, and release"]
types:
- completed

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: pip install mkdocs-material mkdocstrings[python] termynal
- name: Build site (_site directory name is used for Jekyll compatiblity)
run: mkdocs build --config-file ./mkdocs.yml --strict --site-dir ./_site
env:
CI: true
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
43 changes: 43 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish to PyPI

on:
workflow_run:
workflows: ["Commit lint, format, and release"]
types:
- completed

jobs:
check-conditions:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
should-run: ${{ steps.condition-checker.outputs.should-run }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Check conditions
id: condition-checker
run: |
# Check if the latest commit on main has a tag
TAG=$(git tag --points-at HEAD)
if [[ $TAG ]]; then
echo "This commit has a tag: $TAG"
echo "should-run=true" >> $GITHUB_OUTPUT
else
echo "This commit does not have a tag."
echo "should-run=false" >> $GITHUB_OUTPUT
fi
publish:
needs: check-conditions
if: needs.check-conditions.outputs.should-run == 'true'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build and publish to PyPI
uses: JRubics/poetry-publish@v2.0
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Commit lint, format, and release

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
commitlint:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read

steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v6

format-release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: poetry install --no-interaction

- name: Format code
run: |
source .venv/bin/activate
ruff format --check
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,13 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Sample data
/data/
/plots/

# Pyenv
.python-version

# macOS
.DS_Store
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CHANGELOG

## v0.1.0 (2024-07-05)

### Breaking

* feat: add initial features

BREAKING CHANGE: The first few features include a loader, parser, and plotting capabilities. ([`22b833c`](https://github.com/alxdrcirilo/apple-health-parser/commit/22b833ca1d5236fe235db8acfa1b3161e6ddeb8f))

### Unknown

* Initial commit ([`a82d438`](https://github.com/alxdrcirilo/apple-health-parser/commit/a82d4384e5cc5a5a1c864d42cf3a1a751a9f6bb9))
Loading

0 comments on commit 9526224

Please sign in to comment.