Skip to content

Commit bc02f42

Browse files
Change ci runner (lambdaclass#906)
* change ci runner for macos-latest * update criterion_benchs CI * add docker to ci runner * fix docker * add colima * fix colima * docker test * try with cask * Try docker * debug * try * Add colima * install cairo * rm colima * add install gcc * fix * fix * fix * add install gmp * fix creiterion_benchs --------- Co-authored-by: Klaus Lungwitz <klaus.lungwitz@lambdaclass.com>
1 parent 3795dbc commit bc02f42

File tree

2 files changed

+75
-44
lines changed

2 files changed

+75
-44
lines changed

.github/workflows/ci.yaml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ jobs:
3333
- name: Run cargo check cli and stark instruments
3434
run: |
3535
cargo check --features cli,instruments
36-
36+
3737
- name: Run cargo check cli, stark instruments and parallel
3838
run: |
3939
cargo check --features cli,instruments,parallel
4040
4141
- name: Run cargo check for math with no-std
4242
run: cargo check --package lambdaworks-math --no-default-features
43-
43+
4444
- name: Run cargo check for math with wasm target
4545
run: cargo check --package lambdaworks-math --no-default-features --target wasm32-unknown-unknown
4646

@@ -120,9 +120,9 @@ jobs:
120120

121121
- name: Run tests with no std
122122
run: cargo test --package lambdaworks-math --package lambdaworks-crypto --no-default-features
123-
123+
124124
- name: Run tests for math with no std + alloc
125-
run: cargo test --package lambdaworks-math --no-default-features --features=alloc,lambdaworks-serde-string,lambdaworks-serde-binary
125+
run: cargo test --package lambdaworks-math --no-default-features --features=alloc,lambdaworks-serde-string,lambdaworks-serde-binary
126126

127127
- name: Run tests and generate code coverage
128128
run: make coverage
@@ -153,25 +153,42 @@ jobs:
153153
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
154154

155155
- name: Run wasm-pack tests in firefox
156-
run: cd provers/cairo && wasm-pack test --release --firefox --headless -- --features wasm
157-
156+
run: cd provers/cairo && wasm-pack test --release --firefox --headless -- --features wasm
157+
158158
- name: Run wasm-pack tests in chrome
159159
run: cd provers/cairo && wasm-pack test --release --chrome --headless -- --features wasm
160160

161161
test_macos:
162162
name: Test (macOS, Apple sillicon)
163-
runs-on: [self-hosted, macOS]
163+
runs-on: macos-latest
164164
env:
165165
CARGO_TERM_COLOR: always
166166
steps:
167167
- uses: actions/checkout@v3
168168

169+
- name: install GCC/GMP
170+
run: |
171+
brew install gcc
172+
brew install gmp
173+
169174
- name: Rustup toolchain install
170175
uses: dtolnay/rust-toolchain@stable
171176
with:
172177
toolchain: stable
173178
components: clippy
174179

180+
- name: Python3 build
181+
uses: actions/setup-python@v4
182+
with:
183+
python-version: "3.9"
184+
cache: "pip"
185+
186+
- name: Install cairo-lang toolchain and dependencies
187+
env:
188+
CFLAGS: "-I/opt/homebrew/opt/gmp/include"
189+
LDFLAGS: "-L/opt/homebrew/opt/gmp/lib"
190+
run: pip install -r provers/cairo/requirements.txt
191+
175192
- name: Run clippy
176193
run: make clippy-metal
177194

.github/workflows/criterion_benchs.yml

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66

77
permissions:
88
# deployments permission to deploy GitHub pages website
@@ -17,46 +17,60 @@ jobs:
1717
env:
1818
CARGO_TERM_COLOR: always
1919
steps:
20-
- name: Install stable toolchain
21-
uses: dtolnay/rust-toolchain@stable
22-
with:
20+
- name: Install stable toolchain
21+
uses: dtolnay/rust-toolchain@stable
22+
with:
2323
toolchain: stable
24-
- uses: actions/checkout@v3
25-
- name: Run benchmark
26-
run: |
27-
cargo bench --no-fail-fast --bench "criterion_fft" \
28-
--bench "criterion_polynomial" \
29-
-- --output-format bencher | tee output.txt
30-
- name: Store benchmark result
31-
uses: benchmark-action/github-action-benchmark@v1
32-
with:
33-
tool: 'cargo'
34-
output-file-path: output.txt
35-
benchmark-data-dir-path: "./bench"
36-
github-token: ${{ secrets.GITHUB_TOKEN }}
37-
# Push and deploy GitHub pages branch automatically
38-
auto-push: ${{ github.event_name != 'pull_request' }}
24+
- uses: actions/checkout@v3
25+
- name: Run benchmark
26+
run: |
27+
cargo bench --no-fail-fast --bench "criterion_fft" \
28+
--bench "criterion_polynomial" \
29+
-- --output-format bencher | tee output.txt
30+
- name: Store benchmark result
31+
uses: benchmark-action/github-action-benchmark@v1
32+
with:
33+
tool: "cargo"
34+
output-file-path: output.txt
35+
benchmark-data-dir-path: "./bench"
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
# Push and deploy GitHub pages branch automatically
38+
auto-push: ${{ github.event_name != 'pull_request' }}
3939
criterion_bench_macos:
4040
name: Criterion benches (macOS, Apple sillicon)
41-
runs-on: [self-hosted, macOS]
41+
runs-on: macos-latest
4242
env:
4343
CARGO_TERM_COLOR: always
4444
steps:
45-
- name: Install stable toolchain
46-
uses: dtolnay/rust-toolchain@stable
47-
with:
45+
- name: Install stable toolchain
46+
uses: dtolnay/rust-toolchain@stable
47+
with:
4848
toolchain: stable
49-
- uses: actions/checkout@v3
50-
- name: Run benchmark
51-
run: |
52-
cargo bench -F metal --no-fail-fast --bench "criterion_metal" \
53-
-- --output-format bencher | tee output.txt
54-
- name: Store benchmark result
55-
uses: benchmark-action/github-action-benchmark@v1
56-
with:
57-
tool: 'cargo'
58-
output-file-path: output.txt
59-
benchmark-data-dir-path: "./bench"
60-
github-token: ${{ secrets.GITHUB_TOKEN }}
61-
# Push and deploy GitHub pages branch automatically
62-
auto-push: ${{ github.event_name != 'pull_request' }}
49+
- uses: actions/checkout@v3
50+
- name: install GCC/GMP
51+
run: |
52+
brew install gcc
53+
brew install gmp
54+
- name: Python3 build
55+
uses: actions/setup-python@v4
56+
with:
57+
python-version: "3.9"
58+
cache: "pip"
59+
- name: Install cairo-lang toolchain and dependencies
60+
env:
61+
CFLAGS: "-I/opt/homebrew/opt/gmp/include"
62+
LDFLAGS: "-L/opt/homebrew/opt/gmp/lib"
63+
run: pip install -r provers/cairo/requirements.txt
64+
- name: Run benchmark
65+
run: |
66+
cargo bench -F metal --no-fail-fast --bench "criterion_metal" \
67+
-- --output-format bencher | tee output.txt
68+
- name: Store benchmark result
69+
uses: benchmark-action/github-action-benchmark@v1
70+
with:
71+
tool: "cargo"
72+
output-file-path: output.txt
73+
benchmark-data-dir-path: "./bench"
74+
github-token: ${{ secrets.GITHUB_TOKEN }}
75+
# Push and deploy GitHub pages branch automatically
76+
auto-push: ${{ github.event_name != 'pull_request' }}

0 commit comments

Comments
 (0)