Skip to content

Commit

Permalink
chore: run boiler
Browse files Browse the repository at this point in the history
  • Loading branch information
m4tx committed Feb 8, 2024
1 parent 33a0118 commit fcda6b2
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 17 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
version: 2

updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: monthly
groups:
dependencies:
update-types:
- minor
- patch

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: gitsubmodule
directory: /
schedule:
interval: monthly
27 changes: 27 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pre-commit checks

on:
push:
pull_request:

jobs:
pre-commit:
# Run on external PRs and pushes to branches on the repo
# This is to avoid double running on PRs from internal branches
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

name: Linting Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Check files
uses: pre-commit/action@v3.0.0
25 changes: 13 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Rust CI

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"

env:
CARGO_TERM_COLOR: always
Expand All @@ -18,9 +19,9 @@ jobs:
build:
strategy:
matrix:
rust: [ "stable", "nightly", "1.71" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
features: [ "default", "byte", "64", "word_sse41" ]
rust: ["stable", "nightly", "1.71"]
os: [ubuntu-latest, macos-latest, windows-latest]
features: ["default", "byte", "64", "word_sse41"]
include:
- target-cpu: x86-64
- features: word_sse41
Expand All @@ -31,7 +32,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true
submodules: recursive

- name: Cache Cargo registry
uses: actions/cache@v4
Expand Down Expand Up @@ -68,12 +69,12 @@ jobs:

clippy:
runs-on: ubuntu-latest
needs: [ "build" ]
needs: ["build"]
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true
submodules: recursive

- name: Cache Cargo registry
uses: actions/cache@v4
Expand All @@ -84,21 +85,20 @@ jobs:
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }}

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@beta
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy

- name: Run clippy
run: cargo clippy -- -Dclippy::all

rustfmt:
runs-on: ubuntu-latest
needs: [ "build" ]
needs: ["build"]
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true

- name: Cache Cargo registry
uses: actions/cache@v4
Expand All @@ -109,8 +109,9 @@ jobs:
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }}

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt

- name: Run fmt
Expand Down
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [json, yaml]

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Mateusz Maćkowski
Copyright (c) 2022-2024 Mateusz Maćkowski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Low-level [ryg_rans](https://github.com/rygorous/ryg_rans) bindings for [Rust](https://www.rust-lang.org/)
Low-level [ryg_rans](https://github.com/rygorous/ryg_rans) bindings for [Rust](https://www.rust-lang.org/)
==========================================================================================================

[![crates.io](https://img.shields.io/crates/v/ryg_rans_sys.svg)](https://crates.io/crates/ryg_rans_sys)
[![Build Status](https://github.com/m4tx/ryg-rans-sys/workflows/Rust%20CI/badge.svg)](https://github.com/m4tx/ryg-rans-sys/actions)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/m4tx/ryg-rans-sys/blob/master/LICENSE)
[![Rust Build Status](https://github.com/m4tx/ryg-rans-sys/workflows/Rust%20CI/badge.svg)](https://github.com/m4tx/ryg-rans-sys/actions/workflows/rust.yml)
[![crates.io](https://img.shields.io/crates/v/ryg-rans-sys.svg)](https://crates.io/crates/ryg-rans-sys)
[![MIT licensed](https://img.shields.io/github/license/m4tx/ryg-rans-sys)](https://github.com/m4tx/ryg-rans-sys/blob/master/LICENSE)

This crate exposes the raw ryg_rans API.

Expand Down
7 changes: 7 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
unstable_features = true
imports_granularity = "module"
group_imports = "StdExternalCrate"
normalize_comments = true
reorder_impl_items = true
use_field_init_shorthand = true
wrap_comments = true

0 comments on commit fcda6b2

Please sign in to comment.