Skip to content

Commit

Permalink
Deploy eebbe5f to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Deploy from CI committed Oct 2, 2024
0 parents commit 0537a95
Show file tree
Hide file tree
Showing 90 changed files with 19,620 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*.asm linguist-language=Rust
**/*.pil linguist-language=Rust
55 changes: 55 additions & 0 deletions .github/runner/Dockerfile
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"]
41 changes: 41 additions & 0 deletions .github/workflows/build-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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: buildjet-4vcpu-ubuntu-2204

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain 1.81 (with clippy and rustfmt)
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.81-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.81-x86_64-unknown-linux-gnu
- name: Install EStarkPolygon prover dependencies
run: sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm
- name: Lint
run: cargo clippy --all --all-targets --all-features --profile pr-tests -- -D warnings
- name: Lint
run: cargo clippy --all --all-targets --no-default-features --profile pr-tests -- -D warnings
- name: Format
run: cargo fmt --all --check --verbose
- name: Build
run: cargo build --all-targets --all --all-features --profile pr-tests
- name: Check without Halo2
run: cargo check --all --no-default-features --profile pr-tests
- name: ⚡ Save rust cache
uses: buildjet/cache/save@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
Cargo.lock
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.lock') }}
11 changes: 11 additions & 0 deletions .github/workflows/dead-links.yml
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-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'no'
use-verbose-mode: 'yes'
43 changes: 43 additions & 0 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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-latest
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/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages
89 changes: 89 additions & 0 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
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-latest
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-latest
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-latest
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 EStarkPolygon prover dependencies
run: sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm
- 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
- name: Run benchmarks
run: cargo bench
working-directory: compiler
62 changes: 62 additions & 0 deletions .github/workflows/nightly_tests_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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::bgeu) |
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::mulh) |
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::srli) |
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(=double_word) |
test(=function_pointer) |
test(=many_chunks_memory) |
test(=memfuncs) |
test(=password) |
test(=print) |
test(=runtime_affine_256) |
test(=runtime_ec_add) |
test(=runtime_ec_double) |
test(=runtime_modmul_256) |
test(=runtime_poseidon_gl) |
test(=sum) |
test(=trivial) |
test(=two_sums_serde) |
test(=zero_with_values)
Loading

0 comments on commit 0537a95

Please sign in to comment.