Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Lint (errors only)
run: |
pylint -E src || true
- name: Run tests
run: |
pytest -q
49 changes: 49 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy GitHub Pages

on:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Build static site
env:
COMP_URL: ${{ vars.COMP_URL }}
COMP_PAGES: ${{ vars.COMP_PAGES }}
run: |
python scripts/build_site.py
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
28 changes: 0 additions & 28 deletions .github/workflows/test.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ cython_debug/

### Quarto files
main_files
*.html
# Keep html files tracked when generated into site via CI
# Do not ignore all html globally

# Sphinx documentation
!docs/**/*
34 changes: 10 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# ResultAthle
<p align="center"><img src="src/logo.png"></p>

[![ci](https://github.com/Kirscher/ResultAthle/actions/workflows/prod.yml/badge.svg)](https://github.com/Kirscher/ResultAthle/actions/workflows/prod.yml)
[![documentation](https://github.com/Kirscher/ResultAthle/actions/workflows/documentation.yml/badge.svg)](https://github.com/Kirscher/ResultAthle/actions/workflows/documentation.yml)
[![ci](https://github.com/Kirscher/ResultAthle/actions/workflows/ci.yml/badge.svg)](https://github.com/Kirscher/ResultAthle/actions/workflows/ci.yml)

ResultAthle is a project aimed at making statistical tools more accessible at the amateur level in athletics. It addresses the challenges of data manipulation and the lack of accessible descriptive statistics at the club, race, or individual level.

Expand All @@ -13,7 +12,8 @@ ResultAthle is a project aimed at making statistical tools more accessible at th
- [Installation](#installation)
- [Usage](#usage)
- [Python package](#python-package)
- [HTML dashboard with Quarto](#html-dashboard-with-quarto)
- [CLI](#cli)
- [GitHub Pages site](#github-pages-site)
- [Features Under Development](#features-under-development)
- [Contributing](#contributing)
- [License](#license)
Expand All @@ -23,7 +23,7 @@ ResultAthle is a project aimed at making statistical tools more accessible at th
To install the necessary dependencies, run the following command:

```sh
pip install -r requirements.txt
pip install -e ".[dev]"
```

## Usage
Expand All @@ -39,33 +39,19 @@ header, data = scrape_competition(url, num_pages)

Where `url` is the [bases.athle](https://bases.athle.fr/) URL of the competition to scrape and `num_pages` is the number of result pages you want to scrape.

### CLI

You can also use the CLI:

```bash
python -m src.resultathle.cli <url> <num_pages> --out results.csv --json results.json
```

### HTML dashboard with Quarto

Quarto is to be downloaded here: [Quarto URL](https://quarto.org/docs/get-started/).

To convert the main.ipynb to HTML, run:

```sh
quarto render .\main.ipynb --to html
python -m src.resultathle.cli <url> <num_pages> --out results.csv --json results.json --site-dir site
```

To preview the HTML in localhost, run:

```sh
quarto preview .\main.ipynb
```
The optional `--site-dir` renders a static `index.html` using the packaged template, which you can serve via any static host (including GitHub Pages).

To host the HTML, run:
### GitHub Pages site

```sh
quarto preview main.ipynb --port 5000 --host 0.0.0.0 --execute
```
This repository ships with a workflow that builds and deploys a static site to GitHub Pages on each push to `main`. Configure repository variables `COMP_URL` and `COMP_PAGES` to control which competition is scraped at deploy time. The build gracefully falls back to an empty page if scraping fails.


## Features Under Development
Expand Down
831 changes: 0 additions & 831 deletions main.html

This file was deleted.

Loading