Skip to content

Commit 8e1012c

Browse files
author
Deploy from CI
committed
Deploy 16d4df4 to gh-pages
0 parents  commit 8e1012c

File tree

110 files changed

+36769
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+36769
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Feature request
2+
description: Request a new feature
3+
labels: "enhancement"
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to let us know what gget is missing!
9+
- type: dropdown
10+
id: request-type
11+
attributes:
12+
label: Request type
13+
description: Are you requesting the extension of an existing module or a new module?
14+
options:
15+
- Extension of existing module
16+
- New module
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: description
21+
attributes:
22+
label: Request description
23+
description: Please describe your request.
24+
placeholder: Include links to references/databases if applicable.
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: command
29+
attributes:
30+
label: Example command
31+
description: Please provide an example command as you envision it.
32+
render: shell
33+
- type: textarea
34+
id: command-output
35+
attributes:
36+
label: Example return value
37+
description: Please describe what the above-mentioned command should return.
38+
placeholder: What is the most important information? Which format would be most useful?
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Issue / Bug Report
2+
description: Create a report to help us improve
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Thank you for taking the time to fill out this report and help us improve! :)
8+
- type: textarea
9+
id: what-happened
10+
attributes:
11+
label: What happened?
12+
description: Please provide a clear and concise description of what the issue is.
13+
validations:
14+
required: true
15+
- type: textarea
16+
id: version
17+
attributes:
18+
label: gget version
19+
description: Which version of gget are you using?
20+
placeholder: 0.27.2
21+
validations:
22+
required: true
23+
- type: dropdown
24+
id: os
25+
attributes:
26+
label: Operating System (OS)
27+
description: Which Operating System (OS) did you use?
28+
multiple: true
29+
options:
30+
- Linux
31+
- macOS
32+
- Windows
33+
- Other (please specify above)
34+
- Not applicable
35+
validations:
36+
required: true
37+
- type: dropdown
38+
id: interface
39+
attributes:
40+
label: User interface
41+
description: Did the problem occur when calling gget from the command-line or Python? (Select all that apply.)
42+
multiple: true
43+
options:
44+
- Command-line
45+
- Python
46+
- Google Colab (please include a shareable link above)
47+
- R (please specify Python wrapper above)
48+
- Not applicable
49+
validations:
50+
required: true
51+
- type: dropdown
52+
id: m1
53+
attributes:
54+
label: Are you using a computer with an Apple M1 chip?
55+
description: We are asking this because the M1 chip has been causing [problems](https://github.com/pachterlab/gget/issues/30) for some `gget alphafold` dependencies.
56+
options:
57+
- Not M1
58+
- M1
59+
- Not applicable
60+
validations:
61+
required: true
62+
- type: textarea
63+
id: command
64+
attributes:
65+
label: What is the exact command that was run?
66+
description: Please copy-paste the gget command that caused the problem.
67+
render: shell
68+
- type: textarea
69+
id: command-output
70+
attributes:
71+
label: Which output/error did you get?
72+
description: Please copy-paste the complete output/error returned by the command entered above.
73+
render: shell

.github/workflows/ci.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: CI
2+
3+
on:
4+
schedule:
5+
- cron: "0 16 * * 1,4"
6+
push:
7+
paths:
8+
- 'gget/**'
9+
- 'tests/**'
10+
- '!tests/pytest_results_py*.txt'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-22.04
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python: ['3.11', '3.12']
23+
os: ['ubuntu-22.04']
24+
name: Test on Python ${{ matrix.python }}
25+
26+
steps:
27+
- name: Checkout branch
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Setup python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: ${{ matrix.python }}
36+
37+
- name: Install dependencies
38+
run: pip install -r requirements.txt && pip install -r dev-requirements.txt
39+
40+
# Always run tests on push
41+
- name: Run tests
42+
if: github.event_name == 'push'
43+
run: pytest -ra -v --tb=long --maxfail=5 --durations=10 --cov=gget --cov-report=term-missing tests
44+
45+
# On schedule/manual, run tests AND save output (and capture real pytest exit code)
46+
- name: Run tests (save output to file)
47+
id: pytest_saved
48+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
49+
continue-on-error: true
50+
shell: bash
51+
run: |
52+
set -o pipefail
53+
OUT="tests/pytest_results_py${{ matrix.python }}.txt"
54+
echo "Pytest results (Python ${{ matrix.python }}) - $(date -u +"%Y-%m-%dT%H:%M:%SZ")" > "$OUT"
55+
echo "" >> "$OUT"
56+
57+
pytest -ra -v --tb=long --maxfail=5 --durations=10 \
58+
--cov=gget --cov-report=term-missing tests 2>&1 | tee -a "$OUT"
59+
60+
code=${PIPESTATUS[0]}
61+
echo "exit_code=$code" >> "$GITHUB_OUTPUT"
62+
echo "pytest exit code: $code"
63+
64+
- name: Upload pytest results artifact
65+
# create and commit results only for one python version to avoid matrix push races
66+
if: always() && matrix.python == '3.12' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: pytest-results-py${{ matrix.python }}
70+
path: tests/pytest_results_py${{ matrix.python }}.txt
71+
72+
- name: Commit and push pytest results
73+
# create and commit results only for one python version to avoid matrix push races
74+
if: always() && matrix.python == '3.12' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
75+
shell: bash
76+
run: |
77+
set -euo pipefail
78+
79+
git config user.name "github-actions[bot]"
80+
git config user.email "github-actions[bot]@users.noreply.github.com"
81+
82+
git add -A tests/pytest_results_py*.txt
83+
84+
if git diff --cached --quiet; then
85+
echo "No changes to commit."
86+
exit 0
87+
fi
88+
89+
git commit -m "CI: update pytest results"
90+
91+
# Keep branch up-to-date (handles concurrent updates) + retry push
92+
for attempt in 1 2 3 4 5; do
93+
echo "Push attempt $attempt..."
94+
# autostash prevents "cannot rebase: You have unstaged changes" if anything is modified locally
95+
git pull --rebase --autostash origin main || true
96+
if git push origin main; then
97+
exit 0
98+
fi
99+
sleep $((attempt * 5))
100+
done
101+
102+
echo "Push failed after retries."
103+
exit 1
104+
105+
# Make schedule/manual runs still fail if pytest failed
106+
- name: Fail job if pytest failed
107+
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
108+
shell: bash
109+
run: |
110+
code="${{ steps.pytest_saved.outputs.exit_code }}"
111+
if [ -n "$code" ] && [ "$code" != "0" ]; then
112+
exit "$code"
113+
fi

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy Website
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
paths:
8+
- 'docs/**'
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Install mdbook
18+
run: |
19+
mkdir mdbook
20+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.34/mdbook-v0.4.34-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
21+
echo `pwd`/mdbook >> $GITHUB_PATH
22+
- name: Deploy GitHub Pages
23+
run: |
24+
cd docs/
25+
mdbook build
26+
git worktree add gh-pages
27+
git config user.name "Deploy from CI"
28+
git config user.email ""
29+
cd gh-pages
30+
# Delete the ref to avoid keeping history.
31+
git update-ref -d refs/heads/gh-pages
32+
rm -rf *
33+
mv ../book/* .
34+
git add .
35+
git commit -m "Deploy $GITHUB_SHA to gh-pages"
36+
git push --force --set-upstream origin gh-pages
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Backup gget Repo on Google Drive
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 1 * *" # Runs at midnight on the 1st of every month
6+
workflow_dispatch:
7+
8+
jobs:
9+
backup:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Set backup filename
14+
run: echo "BACKUP_FILE=$(echo \"${{ github.repository }}-backup-$(date +%F).tar.gz\" | sed 's/\//-/g')" >> $GITHUB_ENV
15+
16+
- name: Clone the repository (mirror all branches and history)
17+
run: |
18+
git clone --mirror https://github.com/${{ github.repository }}.git repo-mirror
19+
20+
- name: Create backup archive
21+
run: |
22+
tar -czvf "$BACKUP_FILE" repo-mirror
23+
24+
- name: Check if backup archive exists
25+
run: |
26+
if [ -f "$BACKUP_FILE" ]; then
27+
echo "Backup file found: $BACKUP_FILE"
28+
ls -lh "$BACKUP_FILE"
29+
else
30+
echo "Backup file not found!"
31+
exit 1
32+
fi
33+
34+
- name: Create credentials.json
35+
id: create-json
36+
uses: jsdaniell/create-json@v1.2.3
37+
with:
38+
name: "credentials.json"
39+
json: ${{ secrets.GDRIVE_BACKUP_CREDENTIALS }}
40+
41+
- name: Install rclone
42+
run: |
43+
curl https://rclone.org/install.sh | sudo bash
44+
45+
- name: Configure rclone
46+
run: |
47+
mkdir -p ~/.config/rclone/
48+
rclone config create gdrive drive \
49+
--config ~/.config/rclone/rclone.conf \
50+
service_account_file credentials.json || exit 1
51+
52+
- name: Upload archive to Google Drive
53+
run: |
54+
rclone copy "$BACKUP_FILE" gdrive:/GitHub_backups --drive-shared-with-me --verbose || exit 1
55+
56+
- name: Clean up
57+
run: |
58+
rm -rf repo-mirror
59+
rm -f "$BACKUP_FILE"
60+
rm -f credentials.json

.github/workflows/plot_traffic.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Plot Repo Traffic
2+
3+
on:
4+
# Trigger on pushes to traffic branch
5+
push:
6+
branches:
7+
- traffic
8+
# Allow manual trigger
9+
workflow_dispatch:
10+
# Trigger when Traffic workflow finishes
11+
workflow_run:
12+
workflows: ["Traffic"]
13+
types:
14+
- completed
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Check out traffic branch
22+
uses: actions/checkout@v4
23+
with:
24+
ref: traffic
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.8'
30+
31+
- name: Configure pip caching
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.cache/pip
35+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-
38+
39+
- name: Install Python dependencies
40+
run: |
41+
python -m pip install -r requirements.txt
42+
43+
- name: Execute Jupyter notebook
44+
run: jupyter nbconvert --to 'html' --execute gget_traffic.ipynb
45+
46+
- name: Commit and push new data to traffic branch
47+
run: |
48+
git config user.name "Automated"
49+
git config user.email "actions@users.noreply.github.com"
50+
git add plots/*
51+
if ! git diff --cached --quiet; then
52+
timestamp=$(date -u)
53+
git commit -m "Latest data: ${timestamp}"
54+
git push origin traffic
55+
else
56+
echo "No changes to commit"
57+
fi
58+
59+
- name: Clean up
60+
run: rm gget_traffic.html

0 commit comments

Comments
 (0)