-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (88 loc) · 2.58 KB
/
ci.yml
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
name: "CI"
on:
push:
pull_request:
concurrency:
group: "ci-${{ github.ref }}"
cancel-in-progress: true
jobs:
just:
name: "Just"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install the Rust toolchain"
uses: "dtolnay/rust-toolchain@stable"
with:
components: "clippy, rustfmt"
- name: "Install sccache"
uses: "mozilla-actions/[email protected]"
- name: "Install development tools"
uses: "taiki-e/install-action@v2"
with:
tool: "just, cargo-audit, typos"
- name: "Install uv"
run: "curl -LsSf https://astral.sh/uv/install.sh | sh"
- name: "Cache Cargo directories"
uses: "actions/cache@v4"
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db/
target/
key: "${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}"
restore-keys: "${{ runner.os }}-cargo-"
- name: "Cache uv directories"
uses: "actions/cache@v4"
with:
path: |
~/.cache/uv/
.venv/
key: "${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}"
restore-keys: "${{ runner.os }}-uv-"
- name: "Run Just"
run: |
uv python install
touch pyproject.toml
just ci
env:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
RUSTFLAGS: "-D warnings"
- name: "Prune uv cache"
run: "uv cache prune --ci"
- name: "Upload docs artifact"
uses: "actions/upload-artifact@v4"
with:
name: "docs"
path: "./docs/_build/html"
retention-days: 7
pages:
name: "Pages"
if: "github.ref == format('refs/heads/{0}', github.event.repository.default_branch)"
needs: "just"
permissions:
pages: "write"
id-token: "write"
environment:
name: "github-pages"
url: "${{ steps.deployment.outputs.page_url }}"
runs-on: "ubuntu-latest"
steps:
- name: "Download docs artifact"
uses: "actions/download-artifact@v4"
with:
name: "docs"
path: "${{ runner.temp }}/pages/docs"
- name: "Upload pages artifact"
uses: "actions/upload-pages-artifact@v3"
with:
path: "${{ runner.temp }}/pages"
- name: "Deploy pages"
id: "deployment"
uses: "actions/deploy-pages@v4"