Repository navigation
83 lines (69 loc) · 2.21 KB
/
Copy pathci.yml
File metadata and controls
83 lines (69 loc) · 2.21 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
76
77
78
79
80
81
82
83
name: CI
on:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
test:
name: Run tests & display coverage
runs-on: ubuntu-latest
permissions:
pull-requests: write # Post the coverage comment on the PR, and edit it on later runs
contents: write # Push the coverage data to the python-coverage-comment-action-data branch
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: step-security/setup-uv@v10
- name: Install deps
run: uv sync
- name: Run tests
run: uv run pytest
env:
PY_COLORS: 1
- name: Coverage comment
id: coverage_comment
uses: ./
with:
GITHUB_TOKEN: ${{ github.token }}
ANNOTATE_MISSING_LINES: true
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt
docker-build-test:
name: Test Docker image build
runs-on: ubuntu-latest
needs: [test]
permissions:
contents: read
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Docker Buildx
uses: step-security/setup-buildx-action@v4
- name: Build Docker image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: false