Skip to content

Commit

Permalink
Merge pull request #14 from topos-protocol/ci
Browse files Browse the repository at this point in the history
Add CI jobs
  • Loading branch information
Nashtare authored Jan 21, 2024
2 parents 3f659a5 + 95fc8a4 commit c429182
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Continuous Integration

on:
push:
branches: [main]
pull_request:
branches:
- "**"
workflow_dispatch:
branches:
- "**"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
timeout-minutes: 30
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Set up rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Check in protocol_decoder subdirectory
run: cargo check --manifest-path protocol_decoder/Cargo.toml
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
RUST_LOG: 1
CARGO_INCREMENTAL: 1
RUST_BACKTRACE: 1

- name: Check in plonky_block_proof_gen subdirectory
run: cargo check --manifest-path plonky_block_proof_gen/Cargo.toml
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
RUST_LOG: 1
CARGO_INCREMENTAL: 1
RUST_BACKTRACE: 1

- name: Run cargo test
run: cargo test --workspace
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
RUST_LOG: 1
CARGO_INCREMENTAL: 1
RUST_BACKTRACE: 1

lints:
name: Formatting and Clippy
runs-on: ubuntu-latest
timeout-minutes: 10
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy

- name: Set up rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Run cargo fmt
run: cargo fmt --all --check

- name: Run cargo clippy
run: cargo clippy --all-features --all-targets -- -D warnings -A incomplete-features
4 changes: 4 additions & 0 deletions protocol_decoder/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#![feature(linked_list_cursors)]
#![feature(trait_alias)]
#![feature(iter_array_chunks)]
// TODO: address these lints
#![allow(unused)]
#![allow(clippy::type_complexity)]
#![allow(private_interfaces)]

mod compact;
pub mod decoding;
Expand Down

0 comments on commit c429182

Please sign in to comment.