Skip to content

Commit

Permalink
Merge pull request #2 from luizdepra/cartridge-impl
Browse files Browse the repository at this point in the history
Cartridge impl
  • Loading branch information
luizdepra authored Jan 14, 2024
2 parents dd1529e + 4dee9b0 commit 9af09ec
Show file tree
Hide file tree
Showing 25 changed files with 1,533 additions and 172 deletions.
14 changes: 10 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.rs]
max_line_length = 120

[*.md]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

[*.{yml,yaml}]
[*.{json,yml,yaml}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
120 changes: 59 additions & 61 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,108 +1,106 @@
on: [push, pull_request]

name: Continuous Integration

on:
push:
branches:
- main
pull_request:

jobs:
check:
name: Check
fmt:
name: Fmt
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
override: true
toolchain: stable
components: rustfmt

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Restore cache
uses: Swatinem/rust-cache@v1

test:
name: Test Suite
- name: Run fmt
run: cargo fmt --all --check

clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
override: true
toolchain: stable
components: clippy

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
- name: Restore cache
uses: Swatinem/rust-cache@v1

- name: Run clippy
run: cargo clippy --all-targets --all-features --locked -- -D warnings

check:
name: Check

fmt:
name: Rustfmt
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest

runs-on: ${{ matrix.os }}

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Install rustfmt
run: rustup component add rustfmt
- name: Run check
run: cargo check --all-targets --locked

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
test:
name: Test

clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest

runs-on: ${{ matrix.os }}

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Install clippy
run: rustup component add clippy

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Run test
run: cargo test --all-targets --locked
13 changes: 4 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Generated by Cargo
# will have compiled files and executables
/target/

debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk


#Added by cargo
#
#already existing elements are commented out

/target
#**/*.rs.bk
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
45 changes: 30 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
fail_fast: true

repos:
- repo: local
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-executables-have-shebangs
- id: check-json
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: forbid-submodules
- id: mixed-line-ending
- id: mixed-line-ending
- id: no-commit-to-branch
- id: trailing-whitespace

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.1.0
hooks:
- id: fmt
name: fmt
language: system
files: '[.]rs$'
entry: cargo fmt
pass_filenames: false
- id: conventional-pre-commit
stages: [commit-msg]

- id: clippy
name: clippy
language: system
files: '[.]rs$'
entry: cargo clippy
pass_filenames: false
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
args: ['--all-targets', '--locked']
- id: clippy
args: ['--all-targets', '--all-features', '--locked', '--', '-D', 'warnings']
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

---
## [unreleased]

### Miscellaneous Chores

- refactor ci config - ([891c54e](https://github.com/cocogitto/cocogitto/commit/891c54e76239912bd140872e4c3f1df7f169e2e2)) - Luiz F. A. de Prá

<!-- generated by git-cliff -->
73 changes: 67 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[workspace]
members = [
"tinlib",
"devkit"
]
members = ["tinlib", "devkit"]
resolver = "2"
Loading

0 comments on commit 9af09ec

Please sign in to comment.