-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Deploy from CI
committed
Dec 23, 2024
0 parents
commit 1e68c72
Showing
100 changed files
with
62,422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/*.asm linguist-language=Rust | ||
**/*.pil linguist-language=Rust |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# | ||
# Runner for powdr github actions. | ||
# We don't automate runner token generation yet. This image should be used as follows: | ||
# - generate a runner token in github (valid for ~1h) | ||
# - build the docker image passing the token as argument: | ||
# docker buildx build -t github-runner --build-arg TOKEN=THE_GENERATED_TOKEN . | ||
# - this will create an image already registered it with github | ||
# - the container will start the runner (./run.sh) by default. | ||
|
||
# this base image was taken from the Dockerfile in the github runner repo | ||
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy AS build | ||
|
||
ARG RUNNER_VERSION=2.319.1 | ||
|
||
RUN apt-get update && apt install -y curl \ | ||
sudo \ | ||
libicu70 \ | ||
liblttng-ust1 \ | ||
libkrb5-3 \ | ||
zlib1g \ | ||
libssl3 \ | ||
git \ | ||
build-essential \ | ||
clang-15 \ | ||
nlohmann-json3-dev \ | ||
libpqxx-dev \ | ||
nasm \ | ||
libgmp-dev \ | ||
uuid-dev \ | ||
zstd | ||
|
||
RUN adduser --disabled-password --uid 1001 runner \ | ||
&& usermod -aG sudo runner \ | ||
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \ | ||
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers | ||
|
||
USER runner | ||
|
||
WORKDIR /home/runner | ||
|
||
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 \ | ||
&& tar xzf ./runner.tar.gz \ | ||
&& rm runner.tar.gz | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y | ||
|
||
ARG TOKEN | ||
RUN test -n "$TOKEN" || (echo "must set github runner TOKEN: --build-arg TOKEN=XXX" && false) | ||
|
||
RUN ./config.sh --name arch-server --work work --replace --url https://github.com/powdr-labs/powdr --token ${TOKEN} | ||
|
||
# anything that should be in the PATH of the runner must be setup here | ||
ENV PATH="/home/runner/.cargo/bin:$PATH" | ||
|
||
CMD ["./run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Generate rust cache for PR builds | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 2 * * *' # run at 2 AM UTC | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: warp-ubuntu-2404-x64-4x | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
##### The block below is shared between cache build and PR build workflows ##### | ||
- name: Install EStarkPolygon prover dependencies | ||
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 | ||
- name: Install Rust toolchain nightly-2024-09-21 (with clippy and rustfmt) | ||
run: rustup toolchain install nightly-2024-09-21-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain nightly-2024-09-21-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain nightly-2024-09-21-x86_64-unknown-linux-gnu | ||
- name: Install Rust toolchain 1.81 (stable) | ||
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu | ||
- name: Set cargo to perform shallow clones | ||
run: echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV | ||
- name: Cargo check with Rust 1.81 (default features) | ||
run: cargo +1.81-x86_64-unknown-linux-gnu check --all-targets | ||
- name: Lint no default features | ||
run: cargo clippy --all --all-targets --no-default-features --profile pr-tests --verbose -- -D warnings | ||
- name: Lint all features | ||
run: cargo clippy --all --all-targets --all-features --profile pr-tests --verbose -- -D warnings | ||
- name: Format | ||
run: cargo fmt --all --check --verbose | ||
- name: Build | ||
run: cargo build --all-targets --all --all-features --profile pr-tests --verbose | ||
############################################################################### | ||
|
||
- name: Save date of cache build | ||
run: date -R -u > target/cache-build-date.txt | ||
- name: ⚡ Save rust cache | ||
uses: WarpBuilds/cache/save@v1 | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
Cargo.lock | ||
key: ${{ runner.os }}-cargo-pr-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Check markdown links | ||
on: [pull_request, merge_group] | ||
jobs: | ||
markdown-link-check: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: gaurav-nelson/github-action-markdown-link-check@v1 | ||
with: | ||
use-quiet-mode: 'no' | ||
use-verbose-mode: 'yes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# adapted from https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions#GitHub-Pages-Deploy | ||
|
||
name: Deploy book | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-24.04 | ||
permissions: | ||
contents: write # To push a branch | ||
pull-requests: write # To create a PR from that branch | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install latest mdbook | ||
run: | | ||
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') | ||
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" | ||
mkdir mdbook | ||
curl -sSL $url | tar -xz --directory=./mdbook | ||
echo `pwd`/mdbook >> $GITHUB_PATH | ||
- name: Deploy GitHub Pages | ||
run: | | ||
# generate cli docs and inject them into the book | ||
cargo run --package powdr-cli -- --markdown-help > book/src/cli/README.md | ||
# build the book | ||
cd book | ||
mdbook build | ||
git worktree add gh-pages | ||
git config user.name "Deploy from CI" | ||
git config user.email "" | ||
cd gh-pages | ||
# Delete the ref to avoid keeping history. | ||
git update-ref -d refs/heads/gh-pages | ||
rm -rf * | ||
mv ../book/* . | ||
# restore the benchmark directory | ||
git restore --source=origin/gh-pages -- dev | ||
git add . | ||
git commit -m "Deploy $GITHUB_SHA to gh-pages" | ||
git push --force --set-upstream origin gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Nightly tests | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 2 * * *' # run at 2 AM UTC | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
IS_NIGHTLY_TEST: true | ||
POWDR_GENERATE_PROOFS: "true" | ||
|
||
jobs: | ||
check_if_needs_running: | ||
runs-on: ubuntu-24.04 | ||
outputs: | ||
status: ${{ steps.count.outputs.status }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Count recent commits | ||
id: count | ||
run: echo "status=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT | ||
|
||
udeps: | ||
runs-on: ubuntu-22.04 | ||
needs: check_if_needs_running | ||
if: needs.check_if_needs_running.outputs.status > 0 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install nightly toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
|
||
- name: Run cargo-udeps | ||
uses: aig787/cargo-udeps-action@v1 | ||
with: | ||
version: 'latest' | ||
args: '--all-targets' | ||
|
||
test_release: | ||
runs-on: ubuntu-24.04 | ||
needs: check_if_needs_running | ||
if: needs.check_if_needs_running.outputs.status > 0 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: ⚡ Cache rust | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.toml') }} | ||
- name: ⚡ Cache nodejs | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/pilcom/node_modules | ||
key: ${{ runner.os }}-pilcom-node-modules | ||
- name: Install Rust toolchain 1.81 | ||
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu | ||
- name: Install nightly | ||
run: rustup toolchain install nightly-2024-08-01-x86_64-unknown-linux-gnu | ||
- name: Install std source | ||
run: rustup component add rust-src --toolchain nightly-2024-08-01-x86_64-unknown-linux-gnu | ||
- name: Install riscv target | ||
run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2024-08-01-x86_64-unknown-linux-gnu | ||
- name: Install test dependencies | ||
run: sudo apt-get update && sudo apt-get install -y binutils-riscv64-unknown-elf lld | ||
- name: Install EStarkPolygon prover dependencies | ||
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 | ||
- name: Install pilcom | ||
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install | ||
- name: Check without Halo2 | ||
run: cargo check --all --no-default-features | ||
- name: Build | ||
run: cargo build --all --release --all-features | ||
- name: Run tests | ||
# Number threads is set to 1 because the runner does not have enough memeory for more. | ||
run: PILCOM=$(pwd)/pilcom/ cargo test --all --release --verbose --all-features -- --include-ignored --nocapture --test-threads=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
test(=instruction_tests::add) | | ||
test(=instruction_tests::addi) | | ||
test(=instruction_tests::amoadd_w) | | ||
test(=instruction_tests::and) | | ||
test(=instruction_tests::andi) | | ||
test(=instruction_tests::beq) | | ||
test(=instruction_tests::bge) | | ||
test(=instruction_tests::blt) | | ||
test(=instruction_tests::bltu) | | ||
test(=instruction_tests::bne) | | ||
test(=instruction_tests::divu) | | ||
test(=instruction_tests::j) | | ||
test(=instruction_tests::jal) | | ||
test(=instruction_tests::lb) | | ||
test(=instruction_tests::lbu) | | ||
test(=instruction_tests::lh) | | ||
test(=instruction_tests::lhu) | | ||
test(=instruction_tests::lrsc) | | ||
test(=instruction_tests::lw) | | ||
test(=instruction_tests::mul) | | ||
test(=instruction_tests::mulhsu) | | ||
test(=instruction_tests::mulhu) | | ||
test(=instruction_tests::or) | | ||
test(=instruction_tests::ori) | | ||
test(=instruction_tests::remu) | | ||
test(=instruction_tests::rvc) | | ||
test(=instruction_tests::sb) | | ||
test(=instruction_tests::sh) | | ||
test(=instruction_tests::simple) | | ||
test(=instruction_tests::sll) | | ||
test(=instruction_tests::slli) | | ||
test(=instruction_tests::slt) | | ||
test(=instruction_tests::slti) | | ||
test(=instruction_tests::sltiu) | | ||
test(=instruction_tests::sltu) | | ||
test(=instruction_tests::srai) | | ||
test(=instruction_tests::srl) | | ||
test(=instruction_tests::sub) | | ||
test(=instruction_tests::sw) | | ||
test(=instruction_tests::xor) | | ||
test(=instruction_tests::xori) | | ||
test(=byte_access) | | ||
test(=dispatch_table_pie_relocation) | | ||
test(=dispatch_table_static_relocation) | | ||
test(=function_pointer) | | ||
test(=many_chunks_memory) | | ||
test(=memfuncs) | | ||
test(=password) | | ||
test(=print) | | ||
test(=runtime_affine_256) | | ||
test(=runtime_ec_double) | | ||
test(=runtime_modmul_256) | | ||
test(=runtime_poseidon_gl) | | ||
test(=sum) | | ||
test(=trivial) | | ||
test(=two_sums_serde) | | ||
test(=zero_with_values) | | ||
test(=arith_large_test) | | ||
(package(powdr-riscv) and test(=evm)) | | ||
(package(powdr-riscv) and test(=features)) |
Oops, something went wrong.