-
Notifications
You must be signed in to change notification settings - Fork 0
188 lines (160 loc) · 4.68 KB
/
Copy pathci.yml
File metadata and controls
188 lines (160 loc) · 4.68 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
GO_VERSION: "1.23"
PYTHON_VERSION: "3.12"
GOFLAGS: "-mod=readonly"
GOPATH: ${{ github.workspace }}/.go
GOMODCACHE: ${{ github.workspace }}/.go/pkg/mod
GOCACHE: ${{ github.workspace }}/.go/cache
jobs:
go-test:
name: Go · test
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, linux]
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
clean: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Verify modules tidy
run: |
go mod download
go mod verify
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Test (with coverage)
run: go test -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Coverage summary
run: go tool cover -func=coverage.out | tail -20
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: go-coverage
path: coverage.out
retention-days: 7
go-lint:
name: Go · lint
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, linux]
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
clean: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: gofmt check
run: |
fmt_out=$(gofmt -l -s $(go list -f '{{.Dir}}' ./...))
if [ -n "$fmt_out" ]; then
echo "::error::gofmt would reformat:"
echo "$fmt_out"
exit 1
fi
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.62
args: --timeout=5m
skip-cache: false
python-test:
name: Python · test
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, linux]
timeout-minutes: 15
permissions:
contents: read
defaults:
run:
working-directory: addon/skyfield
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
clean: true
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: addon/skyfield/requirements*.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Cache JPL ephemeris (de421.bsp)
uses: actions/cache@v4
with:
path: addon/skyfield/skyfield-data/de421.bsp
key: skyfield-de421-v1
- name: Pre-fetch JPL ephemeris if missing
run: |
mkdir -p skyfield-data
if [ ! -f skyfield-data/de421.bsp ]; then
python -c "from skyfield.api import Loader; Loader('./skyfield-data')('de421.bsp')"
fi
- name: Unit + integration tests
run: python -m unittest discover --start-directory . --pattern 'test_*.py' --verbose
python-lint:
name: Python · lint
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, linux]
timeout-minutes: 5
permissions:
contents: read
defaults:
run:
working-directory: addon/skyfield
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
clean: true
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: addon/skyfield/requirements-dev.txt
- name: Install ruff
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: ruff check
run: ruff check .
- name: ruff format check
run: ruff format --check .