-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (111 loc) · 3.87 KB
/
Copy pathci.yml
File metadata and controls
140 lines (111 loc) · 3.87 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
jobs:
lint:
name: Lint (ruff)
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Set up Python 3.10
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run ruff check
run: ruff check localci/ tests/
- name: Run ruff format check
run: ruff format --check localci/ tests/
typecheck:
name: Typecheck (mypy)
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Set up Python 3.10
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run mypy
run: mypy localci/
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Install yq
env:
YQ_VERSION: v4.53.2
# From https://github.com/mikefarah/yq/releases/download/v4.53.2/checksums (SHA-256 column)
YQ_LINUX_AMD64_SHA256: d56bf5c6819e8e696340c312bd70f849dc1678a7cda9c2ad63eebd906371d56b
run: |
curl -sSfL -o /tmp/yq_linux_amd64 \
"https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64"
echo "${YQ_LINUX_AMD64_SHA256} /tmp/yq_linux_amd64" | sha256sum --check
sudo install -m 755 /tmp/yq_linux_amd64 /usr/local/bin/yq
yq --version
- name: Run tests
run: pytest --cov=localci --cov-report=term-missing -m "not integration"
integration:
name: Integration (act + Docker)
runs-on: ubuntu-latest
needs: [test, typecheck, lint]
timeout-minutes: 30
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Set up Python 3.12
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Install act
env:
ACT_VERSION: v0.2.76
# From https://github.com/nektos/act/releases/download/v0.2.76/checksums.txt
ACT_LINUX_X86_64_SHA256: d4720e05e73ce634239fc0e7fa6b552f9ac79b4e6c878a8756bbfacce3c56720
run: |
curl -sSfL -o /tmp/act.tar.gz \
"https://github.com/nektos/act/releases/download/${ACT_VERSION}/act_Linux_x86_64.tar.gz"
echo "${ACT_LINUX_X86_64_SHA256} /tmp/act.tar.gz" | sha256sum --check
sudo tar xzf /tmp/act.tar.gz -C /usr/local/bin act
act --version
- name: Run integration tests
run: pytest tests/integration -m integration -v --tb=short