-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (76 loc) · 3.43 KB
/
Copy pathci.yml
File metadata and controls
94 lines (76 loc) · 3.43 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
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
branches: [main]
pull_request_target:
types: [opened, synchronize, reopened]
pull_request_review:
types: [submitted]
workflow_dispatch:
inputs:
ref:
description: 'Branch, tag, or SHA to run CI on'
required: false
default: ''
jobs:
lint:
runs-on: self-hosted
if: >
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
(github.event_name == 'pull_request_target' && (contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) || contains(fromJSON('["app/automaticcodeevolutionmanagement", "app/dependabot"]'), github.actor)))
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.event.pull_request.head.sha || github.event.review.commit_id || '' }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync
- name: Check formatting
run: uv run ruff format --check src/
- name: Lint
run: uv run ruff check src/
typecheck:
runs-on: self-hosted
if: >
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
(github.event_name == 'pull_request_target' && (contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) || contains(fromJSON('["app/automaticcodeevolutionmanagement", "app/dependabot"]'), github.actor)))
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.event.pull_request.head.sha || github.event.review.commit_id || '' }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync
- name: Type check with mypy
run: uv run mypy src/
test:
runs-on: self-hosted
if: >
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
(github.event_name == 'pull_request_target' && (contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) || contains(fromJSON('["app/automaticcodeevolutionmanagement", "app/dependabot"]'), github.actor)))
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.event.pull_request.head.sha || github.event.review.commit_id || '' }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync
- name: Run tests with coverage
run: uv run coverage run manage.py test --settings=src.llteacher.test_settings src
- name: Coverage report
run: uv run coverage report