Skip to content

Commit 03c2f3f

Browse files
author
Deploy from CI
committed
Deploy ce7a136 to gh-pages
0 parents  commit 03c2f3f

File tree

100 files changed

+254739
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+254739
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/*.asm linguist-language=Rust
2+
**/*.pil linguist-language=Rust

.github/runner/Dockerfile

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#
2+
# Runner for powdr github actions.
3+
# We don't automate runner token generation yet. This image should be used as follows:
4+
# - generate a runner token in github (valid for ~1h)
5+
# - build the docker image passing the token as argument:
6+
# docker buildx build -t github-runner --build-arg TOKEN=THE_GENERATED_TOKEN .
7+
# - this will create an image already registered it with github
8+
# - the container will start the runner (./run.sh) by default.
9+
10+
# this base image was taken from the Dockerfile in the github runner repo
11+
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy AS build
12+
13+
ARG RUNNER_VERSION=2.319.1
14+
15+
RUN apt-get update && apt install -y curl \
16+
sudo \
17+
libicu70 \
18+
liblttng-ust1 \
19+
libkrb5-3 \
20+
zlib1g \
21+
libssl3 \
22+
git \
23+
build-essential \
24+
clang-15 \
25+
nlohmann-json3-dev \
26+
libpqxx-dev \
27+
nasm \
28+
libgmp-dev \
29+
uuid-dev \
30+
zstd
31+
32+
RUN adduser --disabled-password --uid 1001 runner \
33+
&& usermod -aG sudo runner \
34+
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
35+
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers
36+
37+
USER runner
38+
39+
WORKDIR /home/runner
40+
41+
RUN curl -f -L -o runner.tar.gz https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
42+
&& tar xzf ./runner.tar.gz \
43+
&& rm runner.tar.gz
44+
45+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y
46+
47+
ARG TOKEN
48+
RUN test -n "$TOKEN" || (echo "must set github runner TOKEN: --build-arg TOKEN=XXX" && false)
49+
50+
RUN ./config.sh --name arch-server --work work --replace --url https://github.com/powdr-labs/powdr --token ${TOKEN}
51+
52+
# anything that should be in the PATH of the runner must be setup here
53+
ENV PATH="/home/runner/.cargo/bin:$PATH"
54+
55+
CMD ["./run.sh"]

.github/workflows/build-cache.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Generate rust cache for PR builds
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 2 * * *' # run at 2 AM UTC
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
build:
12+
runs-on: warp-ubuntu-2404-x64-4x
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
submodules: recursive
18+
19+
##### The block below is shared between cache build and PR build workflows #####
20+
- name: Install EStarkPolygon prover dependencies
21+
run: sudo apt-get update && sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc uuid-dev build-essential cmake pkg-config git
22+
- name: Install Rust toolchain nightly-2024-12-17 (with clippy and rustfmt)
23+
run: rustup toolchain install nightly-2024-12-17-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain nightly-2024-12-17-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain nightly-2024-12-17-x86_64-unknown-linux-gnu
24+
- name: Install Rust toolchain 1.81 (stable)
25+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu
26+
- name: Set cargo to perform shallow clones
27+
run: echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV
28+
- name: Cargo check with Rust 1.81 (default features)
29+
run: cargo +1.81-x86_64-unknown-linux-gnu check --all-targets
30+
- name: Lint no default features
31+
run: cargo clippy --all --all-targets --no-default-features --profile pr-tests --verbose -- -D warnings
32+
- name: Lint all features
33+
run: cargo clippy --all --all-targets --all-features --profile pr-tests --verbose -- -D warnings
34+
- name: Format
35+
run: cargo fmt --all --check --verbose
36+
- name: Build
37+
run: cargo build --all-targets --all --all-features --profile pr-tests --verbose
38+
###############################################################################
39+
40+
- name: Save date of cache build
41+
run: date -R -u > target/cache-build-date.txt
42+
- name: ⚡ Save rust cache
43+
uses: WarpBuilds/cache/save@v1
44+
with:
45+
path: |
46+
~/.cargo/registry/index/
47+
~/.cargo/registry/cache/
48+
~/.cargo/git/db/
49+
target/
50+
Cargo.lock
51+
key: ${{ runner.os }}-cargo-pr-tests

.github/workflows/dead-links.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Check markdown links
2+
on: [pull_request, merge_group]
3+
jobs:
4+
markdown-link-check:
5+
runs-on: ubuntu-24.04
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: gaurav-nelson/github-action-markdown-link-check@v1
9+
with:
10+
use-quiet-mode: 'no'
11+
use-verbose-mode: 'yes'

.github/workflows/deploy-book.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# adapted from https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions#GitHub-Pages-Deploy
2+
3+
name: Deploy book
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-24.04
12+
permissions:
13+
contents: write # To push a branch
14+
pull-requests: write # To create a PR from that branch
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Install latest mdbook
20+
run: |
21+
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
22+
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
23+
mkdir mdbook
24+
curl -sSL $url | tar -xz --directory=./mdbook
25+
echo `pwd`/mdbook >> $GITHUB_PATH
26+
- name: Deploy GitHub Pages
27+
run: |
28+
# generate cli docs and inject them into the book
29+
cargo run --package powdr-cli -- --markdown-help > book/src/cli/README.md
30+
# build the book
31+
cd book
32+
mdbook build
33+
git worktree add gh-pages
34+
git config user.name "Deploy from CI"
35+
git config user.email ""
36+
cd gh-pages
37+
# Delete the ref to avoid keeping history.
38+
git update-ref -d refs/heads/gh-pages
39+
rm -rf *
40+
mv ../book/* .
41+
# restore the benchmark directory
42+
git restore --source=origin/gh-pages -- dev
43+
git add .
44+
git commit -m "Deploy $GITHUB_SHA to gh-pages"
45+
git push --force --set-upstream origin gh-pages

.github/workflows/nightly-tests.yml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Nightly tests
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 2 * * *' # run at 2 AM UTC
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
IS_NIGHTLY_TEST: true
10+
POWDR_GENERATE_PROOFS: "true"
11+
12+
jobs:
13+
check_if_needs_running:
14+
runs-on: ubuntu-24.04
15+
outputs:
16+
status: ${{ steps.count.outputs.status }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Count recent commits
21+
id: count
22+
run: echo "status=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT
23+
24+
udeps:
25+
runs-on: ubuntu-22.04
26+
needs: check_if_needs_running
27+
if: needs.check_if_needs_running.outputs.status > 0
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Install nightly toolchain
34+
uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: nightly
37+
override: true
38+
39+
- name: Run cargo-udeps
40+
uses: aig787/cargo-udeps-action@v1
41+
with:
42+
version: 'latest'
43+
args: '--all-targets'
44+
45+
test_release:
46+
runs-on: ubuntu-24.04
47+
needs: check_if_needs_running
48+
if: needs.check_if_needs_running.outputs.status > 0
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
with:
53+
submodules: recursive
54+
- name: ⚡ Cache rust
55+
uses: actions/cache@v4
56+
with:
57+
path: |
58+
~/.cargo/registry
59+
~/.cargo/git
60+
target
61+
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.toml') }}
62+
- name: ⚡ Cache nodejs
63+
uses: actions/cache@v4
64+
with:
65+
path: |
66+
~/pilcom/node_modules
67+
key: ${{ runner.os }}-pilcom-node-modules
68+
- name: Install Rust toolchain 1.81
69+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu
70+
- name: Install nightly
71+
run: rustup toolchain install nightly-2024-08-01-x86_64-unknown-linux-gnu
72+
- name: Install std source
73+
run: rustup component add rust-src --toolchain nightly-2024-08-01-x86_64-unknown-linux-gnu
74+
- name: Install riscv target
75+
run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2024-08-01-x86_64-unknown-linux-gnu
76+
- name: Install test dependencies
77+
run: sudo apt-get update && sudo apt-get install -y binutils-riscv64-unknown-elf lld
78+
- name: Install EStarkPolygon prover dependencies
79+
run: sudo apt-get update && sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc uuid-dev build-essential cmake pkg-config git
80+
- name: Install pilcom
81+
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install
82+
- name: Check without Halo2
83+
run: cargo check --all --no-default-features
84+
- name: Build
85+
run: cargo build --all --release --all-features
86+
- name: Run tests
87+
# Number threads is set to 1 because the runner does not have enough memory for more.
88+
run: PILCOM=$(pwd)/pilcom/ cargo test --all --release --verbose --all-features -- --include-ignored --nocapture --test-threads=1
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
test(=instruction_tests::add) |
2+
test(=instruction_tests::addi) |
3+
test(=instruction_tests::amoadd_w) |
4+
test(=instruction_tests::and) |
5+
test(=instruction_tests::andi) |
6+
test(=instruction_tests::beq) |
7+
test(=instruction_tests::bge) |
8+
test(=instruction_tests::blt) |
9+
test(=instruction_tests::bltu) |
10+
test(=instruction_tests::bne) |
11+
test(=instruction_tests::j) |
12+
test(=instruction_tests::jal) |
13+
test(=instruction_tests::lb) |
14+
test(=instruction_tests::lbu) |
15+
test(=instruction_tests::lh) |
16+
test(=instruction_tests::lhu) |
17+
test(=instruction_tests::lrsc) |
18+
test(=instruction_tests::lw) |
19+
test(=instruction_tests::mul) |
20+
test(=instruction_tests::mulhsu) |
21+
test(=instruction_tests::mulhu) |
22+
test(=instruction_tests::or) |
23+
test(=instruction_tests::ori) |
24+
test(=instruction_tests::remu) |
25+
test(=instruction_tests::rvc) |
26+
test(=instruction_tests::sb) |
27+
test(=instruction_tests::sh) |
28+
test(=instruction_tests::simple) |
29+
test(=instruction_tests::sll) |
30+
test(=instruction_tests::slli) |
31+
test(=instruction_tests::slt) |
32+
test(=instruction_tests::slti) |
33+
test(=instruction_tests::sltiu) |
34+
test(=instruction_tests::sltu) |
35+
test(=instruction_tests::srai) |
36+
test(=instruction_tests::srl) |
37+
test(=instruction_tests::sub) |
38+
test(=instruction_tests::sw) |
39+
test(=instruction_tests::xor) |
40+
test(=instruction_tests::xori) |
41+
test(=byte_access) |
42+
test(=dispatch_table_pie_relocation) |
43+
test(=dispatch_table_static_relocation) |
44+
test(=function_pointer) |
45+
test(=many_chunks_memory) |
46+
test(=memfuncs) |
47+
test(=password) |
48+
test(=print) |
49+
test(=runtime_affine_256) |
50+
test(=runtime_ec_double) |
51+
test(=runtime_modmul_256) |
52+
test(=runtime_poseidon_gl) |
53+
test(=sum) |
54+
test(=trivial) |
55+
test(=two_sums_serde) |
56+
test(=zero_with_values) |
57+
(package(powdr-riscv) and test(=evm)) |
58+
(package(powdr-riscv) and test(=features))

0 commit comments

Comments
 (0)