-
Notifications
You must be signed in to change notification settings - Fork 12
179 lines (150 loc) · 5.3 KB
/
on-commit.yaml
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
name: "On Commit"
on:
push: { branches: [ "develop" ], tags: [ "*" ] }
pull_request: { branches: [ "*" ] }
env:
COLUMNS: 200
PYTEST_FLAGS: --numprocesses auto
SLAP_VERBOSE: more
jobs:
# == Validate data embedded in the Kraken standard library ==
gitignore-io-up-to-date:
runs-on: arc-amd64-small
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- uses: actions/setup-python@v5
with: { python-version: "3.10" }
- run: slap config --venv-type=uv && slap install --link --no-venv-check ${{ matrix.only }}
- run: python -m kraken.std.git.gitignore.gitignore_io
- run: git diff --exit-code
# == Documentation ==
documentation:
runs-on: arc-amd64-small
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- run: pipx install kraken-wrapper==0.34.1 && krakenw config --installer=UV
- run: pipx install mksync
- name: Restore Kraken build cache
uses: actions/cache/restore@v4
with:
path: build
key: build-cache:${{ runner.os }}:${{ hashFiles('.kraken.lock') }}
- run: |
cd docs
for fn in docs/cli/*.md; do mksync -i $fn; done
mksync -i docs/changelog.md
- run: krakenw run mkdocs.build --no-save
- name: Save Kraken build cache
uses: actions/cache/save@v4
with:
path: build
key: build-cache:${{ runner.os }}:${{ hashFiles('.kraken.lock') }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/docs/mkdocs/_site
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/develop'
id: deployment
uses: actions/deploy-pages@v4
# == Unit tests, linting, and type checking ==
test:
runs-on: arc-amd64-small
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.x"]
tasks: ["check lint", "test"]
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python-version }}" }
- run: pip install pipx && pipx install poetry && pipx install pdm && pipx install kraken-wrapper==0.34.1 && krakenw config --installer=UV
- run: rustup update
- run: slap config --venv-type=uv
- name: Restore Kraken build cache
uses: actions/cache/restore@v4
with:
path: build
key: build-cache:${{ runner.os }}:${{ hashFiles('.kraken.lock') }}
- name: Restore Venv
uses: actions/cache/restore@v4
with:
path: .venvs/
key: build-cache:${{ runner.os }}:venv:${{ matrix.python-version }}
# Explicitly mention python.install to ensure that Pip install is rerun.
- run: krakenw run python.install ${{ matrix.tasks }} -vv
- name: Save Venv
uses: actions/cache/save@v4
with:
path: .venvs/
key: build-cache:${{ runner.os }}:venv:${{ matrix.python-version }}
- name: Save Kraken build cache
uses: actions/cache/save@v4
with:
path: build
key: build-cache:${{ runner.os }}:${{ hashFiles('.kraken.lock') }}
# == Try running Kraken as defined in the kraken.yaml file ==
# selftest:
# runs-on: arc-amd64-small
# strategy:
# fail-fast: false
# matrix:
# python-version: ["3.10", "3.11", "3.12", "3.x"]
# steps:
# - uses: actions/checkout@v4
# - uses: NiklasRosenstein/slap@gha/install/v1
# - uses: actions/setup-python@v5
# with: { python-version: "${{ matrix.python-version }}" }
# - run: pip install pipx && pipx install poetry && pipx install pdm
# - run: rustup update
# - name: Restore cache
# uses: actions/cache/restore@v4
# with:
# path: |
# build
# .venvs
# key: build-cache:${{ runner.os }}:selftest
# # - run: slap config --venv-type=uv && slap install --link --no-venv-check ${{ matrix.only }}
# - run: slap install --link --no-venv-check ${{ matrix.only }}
# - run: kraken run python.install fmt lint test -vv
# - run: kraken q ls
# - run: kraken q tree
# - run: kraken q viz
# - run: kraken q d python.mypy
# - run: krakenw run python.install fmt lint test -vv
# - name: Save cache
# uses: actions/cache/save@v4
# with:
# path: |
# build
# .venvs
# key: build-cache:${{ runner.os }}:selftest
# uv-installer:
# runs-on: arc-amd64-small
# steps:
# - uses: actions/checkout@v4
# - uses: NiklasRosenstein/slap@gha/install/v1
# - run: slap config --venv-type=uv && slap install --link --no-venv-check
# - run: krakenw --reinstall --use=UV
# - run: krakenw run fmt lint
examples-docker-manual:
runs-on: arc-amd64-small
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.x"]
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python-version }}" }
- run: slap config --venv-type=uv && slap install --link --no-venv-check ${{ matrix.only }}
- run: cd examples/docker-manual && kraken run :dockerBuild :sub:helloWorld