-
Notifications
You must be signed in to change notification settings - Fork 30
67 lines (58 loc) · 1.85 KB
/
Copy pathci-checks.yml
File metadata and controls
67 lines (58 loc) · 1.85 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
name: Run Tests and Check Documentation
on:
pull_request:
permissions:
contents: read
jobs:
ci-checks:
runs-on: ubuntu-24.04-arm
env:
PYTHON_VERSION: "3.13"
TASKFILE_VERSION: "v3.44.0"
TASKFILE_PATH: "/home/runner/go/bin"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
which task || curl -sSfL https://taskfile.dev/install.sh | sh -s -- -b ${{ env.TASKFILE_PATH }} ${{ env.TASKFILE_VERSION }}
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
task init:ci
- name: Check code formatting
run: |
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
task fmt > /dev/null 2>&1
if git diff --quiet; then
echo "Code is properly formatted."
else
echo "Please format the code by running 'task fmt'."
exit 1
fi
- name: Check linting
run: |
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
task lint > /dev/null 2>&1
if git diff --quiet; then
echo "Code is properly linted."
else
echo "Please lint the code by running 'task lint'."
exit 1
fi
- name: Run tests
run: |
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
task test
- name: Check license headers and files
run: |
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
task license:headers > /dev/null 2>&1
if git diff --quiet; then
echo "License headers are up to date!"
else
echo "Please update license headers by running 'task license:headers'."
exit 1
fi