Skip to content

Commit 56a154b

Browse files
committed
Replace lint-and-test with ci.yml
This is shorter and runs on every commit pushed, so it can run on branches before they get PRed, irrespective if they're into `main` or not. The coverage task only runs on the main branch.
1 parent 5393bc6 commit 56a154b

File tree

2 files changed

+68
-94
lines changed

2 files changed

+68
-94
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
gitleaks:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v5
10+
with:
11+
fetch-depth: 0 # Full history is needed to scan all commits
12+
- uses: jdx/mise-action@v3
13+
with:
14+
cache: true
15+
- run: gitleaks detect --verbose --redact
16+
17+
pytest:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5
21+
- uses: jdx/mise-action@v3
22+
with:
23+
cache: true
24+
- env:
25+
SECRET_KEY: "${{ secrets.SECRET_KEY_FOR_TESTS }}"
26+
run: make test
27+
28+
ruff:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v5
32+
- uses: jdx/mise-action@v3
33+
with:
34+
cache: true
35+
- run: make lint
36+
37+
coverage:
38+
needs: [pytest]
39+
runs-on: ubuntu-latest
40+
if: github.ref == 'refs/heads/main'
41+
outputs:
42+
badge_url: ${{ steps.upload-coverage-badge-artifact-step.outputs.artifact-url }}
43+
html_report_url: ${{ steps.upload-html-report-artifact-step.outputs.artifact-url }}
44+
steps:
45+
- uses: actions/checkout@v5
46+
- uses: jdx/mise-action@v3
47+
with:
48+
cache: true
49+
- env:
50+
SECRET_KEY: "${{ secrets.SECRET_KEY_FOR_TESTS }}"
51+
COVERAGE_THRESHOLD: 80
52+
run: make test-coverage
53+
- uses: actions/upload-artifact@v4
54+
id: upload-html-report-artifact-step
55+
if: always()
56+
with:
57+
name: coverage-html
58+
path: htmlcov
59+
retention-days: 10
60+
compression-level: 0
61+
- uses: actions/upload-artifact@v4
62+
id: upload-coverage-badge-artifact-step
63+
if: always()
64+
with:
65+
name: coverage-badge
66+
path: coverage.svg
67+
retention-days: 10
68+
compression-level: 0

.github/workflows/lint-and-test.yaml

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)