Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 19 additions & 71 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
branches: main

pull_request:
branches: main
types:
- opened
- reopened
Expand All @@ -19,113 +18,62 @@ on:
- 'cargo-concordium/**/*.rs'
- 'cargo-concordium/**/*.toml'
- 'rustfmt.toml'
- 'Cargo.toml'
- 'rust-toolchain.toml'
- 'concordium-base'

workflow_dispatch: # allows manual trigger

env:
RUST_VERSION: 1.85

jobs:
"lint_fmt":
name: ${{ matrix.build-dir }} lint:fmt
name: lint:fmt
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
strategy:
matrix:
build-dir:
- 'cargo-concordium'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
components: rustfmt
- name: Format
working-directory: ${{ matrix.build-dir }}
run: |
rustup component add rustfmt
cargo fmt -- --color=always --check

# For binaries we additionally commit the lock file. And we want to ensure
# that the file is up-to-date.
"lint_clippy_binaries":
name: ${{ matrix.build-dir }} lint:clippy
name: lint:clippy
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
strategy:
matrix:
build-dir:
- 'cargo-concordium'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
components: clippy
- name: Clippy
working-directory: ${{ matrix.build-dir }}
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
cargo clippy --locked --color=always --tests --benches -- -Dclippy::all
rustup component add clippy
cargo clippy --color=always --all-targets --all-features --locked -- -D warnings

"cargo-concordium_cargo_build-bench":
Comment thread
allanbrondum marked this conversation as resolved.
name: cargo-concordium cargo:build-bench
"cargo_test":
name: cargo:test
runs-on: ubuntu-latest
needs:
- lint_clippy_binaries
- lint_fmt
strategy:
matrix:
build-dir:
- 'cargo-concordium'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
components: clippy
- name: Cargo check
working-directory: ${{ matrix.build-dir }}
run: cargo check --benches --tests
- name: Test
run: cargo test --all-features

"cargo_test":
name: ${{ matrix.build-dir }} cargo:test
rustdoc:
name: cargo:doc
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
needs:
- cargo-concordium_cargo_build-bench
strategy:
matrix:
build-dir:
- 'cargo-concordium'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Test
working-directory: ${{ matrix.build-dir }}
run: cargo test
- name: Docs
run: |
rustup component add rust-docs
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
Loading
Loading