Skip to content

Commit

Permalink
CI: rename workflow file and improvements, pre-commit
Browse files Browse the repository at this point in the history
- Rename workflow file
- Multi-platform build (linux, windows and macos)
- Check cargo fmt and clippy
- Check pre-commit
  • Loading branch information
BiagioFesta committed Jul 14, 2023
1 parent 2cfad87 commit 6d7bf38
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 22 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches: ["master"]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build
run: cargo build --all-targets --all-features --verbose
- name: Run tests
run: cargo test --verbose

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Fmt
run: cargo fmt --all -- --check

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
22 changes: 0 additions & 22 deletions .github/workflows/rust.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
- id: clippy

0 comments on commit 6d7bf38

Please sign in to comment.