-
Notifications
You must be signed in to change notification settings - Fork 97
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
Feb 8, 2024
0 parents
commit a946e50
Showing
79 changed files
with
16,157 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,11 @@ | ||
name: Check markdown links | ||
on: [pull_request, merge_group] | ||
jobs: | ||
markdown-link-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- 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,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@v3 | ||
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 |
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,85 @@ | ||
name: Nightly tests | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 2 * * *' # run at 2 AM UTC | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check_if_needs_running: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
status: ${{ steps.count.outputs.status }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- 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@v2 | ||
|
||
- 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@v3 | ||
with: | ||
submodules: recursive | ||
- name: ⚡ Cache rust | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.toml') }} | ||
- name: ⚡ Cache nodejs | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/pilcom/node_modules | ||
key: ${{ runner.os }}-pilcom-node-modules | ||
- name: Install Rust toolchain 1.72 | ||
run: rustup toolchain install 1.72-x86_64-unknown-linux-gnu | ||
- name: Install nightly | ||
run: rustup toolchain install nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- name: Install riscv target | ||
run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- name: Install stdlib | ||
run: rustup component add rust-src --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- 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 |
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,144 @@ | ||
name: PR tests | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: ⚡ Restore rust cache | ||
id: cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-pr-tests- | ||
- name: ⚡ Cache nodejs | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/pilcom/node_modules | ||
key: ${{ runner.os }}-pilcom-node-modules | ||
- name: Install Rust toolchain 1.72 (with clippy and rustfmt) | ||
run: rustup toolchain install 1.72-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.72-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.72-x86_64-unknown-linux-gnu | ||
- 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 | ||
- uses: taiki-e/install-action@nextest | ||
- name: Create tests archive | ||
run: cargo nextest archive --archive-file tests.tar.zst --cargo-profile pr-tests --workspace --all-features | ||
- name: ⚡ Save rust cache | ||
if: github.ref == 'refs/heads/main' | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Upload tests archive | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: tests_archive | ||
path: tests.tar.zst | ||
|
||
test_quick: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: tests_archive | ||
- name: ⚡ Cache nodejs | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/pilcom/node_modules | ||
key: ${{ runner.os }}-pilcom-node-modules | ||
- name: Install Rust toolchain 1.72 (with clippy and rustfmt) | ||
run: rustup toolchain install 1.72-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.72-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.72-x86_64-unknown-linux-gnu | ||
- name: Install nightly | ||
run: rustup toolchain install nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- name: Install riscv target | ||
run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- name: Install stdlib | ||
run: rustup component add rust-src --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- name: Install pilcom | ||
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install | ||
- uses: taiki-e/install-action@nextest | ||
- name: Run default tests | ||
run: PILCOM=$(pwd)/pilcom/ cargo nextest run --archive-file tests.tar.zst --verbose | ||
|
||
test_slow: | ||
strategy: | ||
matrix: | ||
test: | ||
- "subset1" | ||
- "subset2" | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: tests_archive | ||
- name: ⚡ Cache nodejs | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/pilcom/node_modules | ||
key: ${{ runner.os }}-pilcom-node-modules | ||
- name: Install Rust toolchain 1.72 (with clippy and rustfmt) | ||
run: rustup toolchain install 1.72-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.72-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.72-x86_64-unknown-linux-gnu | ||
- name: Install nightly | ||
run: rustup toolchain install nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- name: Install riscv target | ||
run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- name: Install stdlib | ||
run: rustup component add rust-src --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu | ||
- name: Install pilcom | ||
run: git clone https://github.com/0xPolygonHermez/pilcom.git && cd pilcom && npm install | ||
- uses: taiki-e/install-action@nextest | ||
- name: Run slow tests | ||
# Number threads is set to 1 because the runner does not have enough memory for more. | ||
run: | | ||
if [[ "${{ matrix.test }}" == "subset1" ]]; then | ||
TESTS="test(=test_keccak) | test(=test_vec_median) | test(=instruction_tests::addi) | test(=arith_test)" | ||
elif [[ "${{ matrix.test }}" == "subset2" ]]; then | ||
TESTS="test(=test_many_chunks)" | ||
fi | ||
PILCOM=$(pwd)/pilcom/ cargo nextest run --archive-file tests.tar.zst --verbose --run-ignored=ignored-only --no-capture -E "$TESTS" | ||
shell: bash |
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,13 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
riscv/runtime/target | ||
cargo_target/ |
Oops, something went wrong.