|
4 | 4 | push: |
5 | 5 | branches: [main] |
6 | 6 | pull_request: |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
7 | 12 |
|
8 | 13 | permissions: |
9 | 14 | contents: read |
10 | 15 |
|
11 | 16 | jobs: |
| 17 | + quality: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + timeout-minutes: 15 |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 22 | + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 |
| 23 | + with: |
| 24 | + python-version: "3.13" |
| 25 | + - run: python -m pip install "uv==0.11.24" |
| 26 | + - run: uv sync --frozen --extra dev --extra s3 |
| 27 | + - run: uv run ruff check . |
| 28 | + - run: uv run mypy src |
| 29 | + - run: uv run pip-audit |
| 30 | + - run: uv build --out-dir dist |
| 31 | + - name: Smoke-test built wheel |
| 32 | + run: | |
| 33 | + python -m venv /tmp/github-backup-wheel-test |
| 34 | + /tmp/github-backup-wheel-test/bin/python -m pip install --no-deps dist/*.whl |
| 35 | + /tmp/github-backup-wheel-test/bin/github-backup --version |
| 36 | + /tmp/github-backup-wheel-test/bin/github-backup help run |
| 37 | +
|
12 | 38 | test: |
13 | 39 | runs-on: ubuntu-latest |
| 40 | + timeout-minutes: 15 |
14 | 41 | strategy: |
15 | 42 | fail-fast: false |
16 | 43 | matrix: |
17 | 44 | python-version: ["3.11", "3.12", "3.13"] |
18 | 45 | steps: |
19 | | - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 |
20 | | - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 46 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 47 | + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 |
21 | 48 | with: |
22 | 49 | python-version: ${{ matrix.python-version }} |
23 | | - cache: pip |
24 | 50 | - run: python -m pip install "uv==0.11.24" |
25 | 51 | - run: uv sync --frozen --extra dev --extra s3 |
26 | | - - run: uv run ruff check . |
27 | | - - run: uv run mypy src |
28 | 52 | - run: uv run pytest --cov=github_backup --cov-report=term-missing --cov-fail-under=80 |
29 | | - - run: uv run pip-audit |
| 53 | + |
| 54 | + docker: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + timeout-minutes: 20 |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 59 | + - name: Build container image |
| 60 | + run: docker build --pull --provenance=false --tag github-backup:ci . |
| 61 | + - name: Scan container for actionable high/critical vulnerabilities |
| 62 | + uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 |
| 63 | + with: |
| 64 | + image-ref: github-backup:ci |
| 65 | + scanners: vuln |
| 66 | + vuln-type: os,library |
| 67 | + severity: CRITICAL,HIGH |
| 68 | + ignore-unfixed: true |
| 69 | + exit-code: "1" |
| 70 | + - name: Smoke-test container image |
| 71 | + run: | |
| 72 | + docker run --rm --read-only --cap-drop=ALL --security-opt=no-new-privileges \ |
| 73 | + github-backup:ci --version |
| 74 | + docker run --rm --read-only --cap-drop=ALL --security-opt=no-new-privileges \ |
| 75 | + github-backup:ci help run |
0 commit comments