Skip to content

Commit 53f8e2a

Browse files
committed
Add workflow boilerplate.
0 parents  commit 53f8e2a

File tree

7 files changed

+214
-0
lines changed

7 files changed

+214
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
env:
10+
PYTHON_VERSION: "3.10" # Define Python version globally
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ env.PYTHON_VERSION }}
24+
25+
- name: Cache dependencies
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.cache/pip
29+
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
30+
restore-keys: |
31+
${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-
32+
${{ runner.os }}-pip-
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -e .
38+
pip install -r requirements.txt
39+
40+
- name: Run tests
41+
run: pytest
42+
43+
deploy:
44+
runs-on: ubuntu-latest
45+
needs: test
46+
if: github.ref == 'refs/heads/main'
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v4
54+
with:
55+
python-version: ${{ env.PYTHON_VERSION }}
56+
57+
- name: Install dependencies
58+
run: |
59+
python -m pip install --upgrade pip
60+
pip install -r requirements.txt
61+
62+
- name: Deploy Application
63+
run: |
64+
echo "Deploying application..."
65+
# Add actual deployment commands here, e.g.:
66+
# scp -r . user@server:/path/to/app
67+
# ssh user@server "systemctl restart my-app"
68+
69+
- name: Notify Deployment Success
70+
run: echo "Deployment successful!"

.gitignore

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
venv/
13+
venv.bak/
14+
build/
15+
develop-eggs/
16+
dist/
17+
eggs/
18+
*.egg-info/
19+
.installed.cfg
20+
*.egg
21+
22+
# Setuptools & wheel
23+
*.manifest
24+
*.spec
25+
pip-wheel-metadata/
26+
wheelhouse/
27+
28+
# PyInstaller
29+
*.exe
30+
*.dll
31+
*.pyd
32+
*.pack
33+
*.log
34+
*.log.*
35+
36+
# Virtual environments
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
pip-selfcheck.json
40+
41+
# Poetry
42+
.poetry/
43+
.cache/
44+
poetry.lock
45+
46+
# Pipenv
47+
Pipfile
48+
Pipfile.lock
49+
50+
# conda environments
51+
*.conda
52+
conda-meta/
53+
conda-build/
54+
envs/
55+
*.yaml
56+
*.yml
57+
58+
# mypy
59+
.mypy_cache/
60+
.dmypy.json
61+
dmypy.json
62+
63+
# pytest
64+
.pytest_cache/
65+
66+
# tox
67+
.tox/
68+
*.tox
69+
.cache/
70+
nosetests.xml
71+
coverage.xml
72+
*.cover
73+
.hypothesis/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints/
77+
78+
# PEP 582 (Module-based virtual environments)
79+
__pypackages__/
80+
81+
# PyCharm / VSCode / IDE settings
82+
.idea/
83+
.vscode/
84+
*.sublime-workspace
85+
*.sublime-project
86+
*.vscode/
87+
88+
# Editor backups & logs
89+
*.swp
90+
*.swo
91+
*~
92+
*#
93+
*.bak
94+
*.orig
95+
*.log
96+
97+
# macOS / Windows system files
98+
.DS_Store
99+
Thumbs.db
100+
desktop.ini
101+
102+
# dotenv environment variables
103+
.env
104+
.env.*
105+
*.secrets
106+
107+
# Docker
108+
docker-compose.override.yml
109+
.dockerignore
110+
111+
# Cloud and deployment
112+
*.pem
113+
*.pub
114+
terraform.tfstate
115+
*.tfstate.backup
116+
117+
# Temporary files
118+
*.temp
119+
*.tmp

README.md

Whitespace-only changes.

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build-system]
2+
requires = ["setuptools>=64"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "abolition-now-internet-archive"
7+
version = "0.1"
8+
dependencies = [
9+
"pytest"
10+
]
11+
12+
[tool.setuptools]
13+
packages = ["src"]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest

src/hello.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def say_hello():
2+
return "Hello, World!"
3+
4+
5+
if __name__ == "__main__":
6+
print(say_hello())

tests/test_hello.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from src.hello import say_hello
2+
3+
4+
def test_say_hello():
5+
assert say_hello() == "Hello, World!"

0 commit comments

Comments
 (0)