-
Notifications
You must be signed in to change notification settings - Fork 6
80 lines (63 loc) · 1.83 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# .github/workflows/ci.yml
name: CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: continuous-integration
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
# - name: Run tests
# # For example, using `pytest`
# run: uv run pytest tests
# Format code
- name: Format code
run: uvx black py_launch_blueprint/ --check
- name: Sort imports
run: uvx isort py_launch_blueprint/ --check
- name: Run type checker
run: uvx mypy py_launch_blueprint/
- name: Check linters
run: uvx ruff check py_launch_blueprint/
# - name: Run tests with coverage
# run: |
# pytest --cov=./ --cov-report=xml
# - name: Upload coverage
# uses: codecov/codecov-action@v4
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Safety CLI to check for vulnerabilities
uses: pyupio/safety-action@v1
with:
api-key: ${{ secrets.SAFETY_API_KEY }}
args: --detailed-output # To always see detailed output from this action
# publish:
# needs: [test, security]
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Build and publish to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# run: |
# uv pip install build twine
# python -m build
# twine upload dist/*