Repository navigation
75 lines (69 loc) · 2.54 KB
/
Copy pathci.yml
File metadata and controls
75 lines (69 loc) · 2.54 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
quality:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.13"
- run: python -m pip install "uv==0.11.24"
- run: uv sync --frozen --extra dev --extra s3
- run: uv run ruff check .
- run: uv run mypy src
- run: uv run pip-audit
- run: uv build --out-dir dist
- name: Smoke-test built wheel
run: |
python -m venv /tmp/github-backup-wheel-test
/tmp/github-backup-wheel-test/bin/python -m pip install --no-deps dist/*.whl
/tmp/github-backup-wheel-test/bin/github-backup --version
/tmp/github-backup-wheel-test/bin/github-backup help run
test:
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install "uv==0.11.24"
- run: uv sync --frozen --extra dev --extra s3
- run: uv run pytest --cov=github_backup --cov-report=term-missing --cov-fail-under=80
docker:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Build container image
run: docker build --pull --provenance=false --tag github-backup:ci .
- name: Scan container for actionable high/critical vulnerabilities
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
image-ref: github-backup:ci
scanners: vuln
vuln-type: os,library
severity: CRITICAL,HIGH
ignore-unfixed: true
exit-code: "1"
- name: Smoke-test container image
run: |
docker run --rm --read-only --cap-drop=ALL --security-opt=no-new-privileges \
github-backup:ci --version
docker run --rm --read-only --cap-drop=ALL --security-opt=no-new-privileges \
github-backup:ci help run