Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update and fix pull request checks #31

Merged
merged 1 commit into from
Jul 9, 2024
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
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]
workflow_dispatch:

env:
# Disable incremental compilation. CI builds are often closer to from-scratch builds, as changes
# are typically bigger than from a local edit-compile cycle.
# Incremental compilation also significantly increases the amount of IO and the size of ./target
# folder, which makes caching less effective.
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# Cache should never takes more than a few seconds to get downloaded.
# If it does, let’s just rebuild from scratch instead of hanging "forever".
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
# Disabling debug info so compilation is faster and ./target folder is smaller.
CARGO_PROFILE_DEV_DEBUG: 0

jobs:
formatting:
name: Check formatting
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

- name: Check formatting
run: cargo fmt --all --check

checks:
name: Checks [${{ matrix.os }}]
runs-on: ${{ matrix.runner }}
needs: formatting
strategy:
fail-fast: false
matrix:
os: [ windows, linux ]
include:
- os: windows
runner: windows-2019
- os: linux
runner: ubuntu-22.04 # 22.04 because we need a recent wabt version

steps:
- uses: actions/checkout@v4

- name: Rust cache
uses: Swatinem/[email protected]

- name: Tests
run: cargo test --workspace -v

- name: Lints
run: cargo clippy --workspace -v -- -Dwarnings

success:
name: Success
runs-on: ubuntu-latest
if: ${{ success() }}
needs:
- formatting
- checks

steps:
- name: CI succeeded
run: exit 0
58 changes: 0 additions & 58 deletions .github/workflows/rust.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ impl<M: Model> Repository<M> {
V: Borrow<Vec<U>> + Send + Sync,
U: Borrow<BulkUpdate> + Send + Sync,
{
Ok(self.coll.bulk_update(&self.db, updates).await?)
self.coll.bulk_update(&self.db, updates).await
}
}

Expand Down