forked from cairo-book/cairo-book
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (80 loc) · 2.71 KB
/
Copy pathci.yml
File metadata and controls
98 lines (80 loc) · 2.71 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
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
compile_and_verify:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache pnpm and node modules
uses: actions/cache@v4
with:
path: |
~/.pnpm-store
node_modules
key: pnpm-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Cache asdf tools
uses: actions/cache@v4
with:
path: |
~/.asdf
~/.cache/scarb
~/.cache/starknet-foundry
key: asdf-${{ runner.os }}-${{ hashFiles('.tool-versions') }}
restore-keys: |
asdf-${{ runner.os }}-
- name: Install asdf & tools
uses: asdf-vm/actions/install@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Install Universal Sierra Compiler
run: |
curl -L https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh
- name: Set default scarb version
run: asdf set -u scarb $(cat .tool-versions | grep scarb | cut -d ' ' -f 2)
- name: Set default starknet-foundry version
run: asdf set -u starknet-foundry $(cat .tool-versions | grep starknet-foundry | cut -d ' ' -f 2)
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Cache mdbook binaries
id: cache-mdbook
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.local/bin
key: mdbook-${{ runner.os }}-v4-${{ hashFiles('.tool-versions', '.github/workflows/install-mdbook/action.yml') }}
- name: Install mdbook and dependencies
if: steps.cache-mdbook.outputs.cache-hit != 'true'
uses: ./.github/workflows/install-mdbook
- name: Add binary paths to PATH
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash
- name: Build book (English)
run: mdbook build -d book
- name: Install cairo-listings
if: steps.cache-mdbook.outputs.cache-hit != 'true'
run: cargo install --git https://github.com/enitrat/cairo-listings --locked
shell: bash
- name: Run cairo-listings and generate summary
run: cairo-listings verify >> $GITHUB_STEP_SUMMARY
shell: bash
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master