From d13e3cbdbee739c0e3f915e0627ab3b2571f3a3f Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 15 Dec 2023 14:01:51 +0000 Subject: [PATCH] Set up CI for repo --- .github/dependabot.yml | 8 +++++ .github/workflows/lints.yml | 61 ++++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 19 +++++++++++ plonkish-encoding/Cargo.toml | 3 ++ plonkish-encoding/src/lib.rs | 2 +- plonkish-relation/src/lib.rs | 2 +- rust-toolchain.toml | 3 ++ 7 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/lints.yml create mode 100644 .github/workflows/tests.yml create mode 100644 rust-toolchain.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..cb51f48 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + timezone: Etc/UTC + open-pull-requests-limit: 10 diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml new file mode 100644 index 0000000..50d66e0 --- /dev/null +++ b/.github/workflows/lints.yml @@ -0,0 +1,61 @@ +name: Lints + +# We only run these lints on trial-merges of PRs to reduce noise. +on: pull_request + +jobs: + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Clippy check + uses: auguwu/clippy-action@1.2.2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + all-features: true + deny: warnings + + doc-links: + name: Intra-doc links + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: cargo fetch + # Requires #![deny(rustdoc::broken_intra_doc_links)] in crates. + - name: Check intra-doc links + run: cargo doc --workspace --all-features --document-private-items + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check formatting + run: cargo fmt --all --check + + hacspec: + name: hacspec syntax + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Install hax + run: nix profile install github:hacspec/hax + + - name: Check syntax + run: cargo hax json + working-directory: ./plonkish-relation + + - name: Check compilation to Coq + run: cargo hax into coq + working-directory: ./plonkish-relation + + - name: Check compilation to Easycrypt + run: cargo hax into easycrypt + working-directory: ./plonkish-relation + + - name: Check compilation to F* + run: cargo hax into fstar + working-directory: ./plonkish-relation diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..27b915f --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,19 @@ +name: Tests + +on: [push, pull_request] + +jobs: + test: + name: Run on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v3 + - run: cargo fetch + - name: Build tests + run: cargo build --workspace --verbose --all-features --tests + - name: Run tests + run: cargo test --workspace --verbose --all-features diff --git a/plonkish-encoding/Cargo.toml b/plonkish-encoding/Cargo.toml index d31360f..6de24d7 100644 --- a/plonkish-encoding/Cargo.toml +++ b/plonkish-encoding/Cargo.toml @@ -7,3 +7,6 @@ description = "An encoding format for PLONKish arithmetic circuits" license.workspace = true [dependencies] + +[dev-dependencies] +plonkish-relation = { path = "../plonkish-relation" } diff --git a/plonkish-encoding/src/lib.rs b/plonkish-encoding/src/lib.rs index 8b13789..9dd0e43 100644 --- a/plonkish-encoding/src/lib.rs +++ b/plonkish-encoding/src/lib.rs @@ -1 +1 @@ - +#![deny(rustdoc::broken_intra_doc_links)] diff --git a/plonkish-relation/src/lib.rs b/plonkish-relation/src/lib.rs index 8b13789..9dd0e43 100644 --- a/plonkish-relation/src/lib.rs +++ b/plonkish-relation/src/lib.rs @@ -1 +1 @@ - +#![deny(rustdoc::broken_intra_doc_links)] diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..d0ead5e --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "stable" +components = ["clippy", "rustfmt"]