From 1266b0134c5ea886860dd3c3e985c9c5ecfad209 Mon Sep 17 00:00:00 2001 From: GuidoEspana Date: Sun, 28 Jul 2024 10:56:23 -0500 Subject: [PATCH] Preliminary test with pre-commit - resolves #3 (#5) --- .gitattributes | 1 - .github/workflows/build-test.yaml | 20 ++++++++++++++++++++ .github/workflows/pre-commit.yaml | 13 +++++++++++++ .gitignore | 4 ++++ .pre-commit-config.yaml | 15 +++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-test.yaml create mode 100644 .github/workflows/pre-commit.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.gitattributes b/.gitattributes index dcdf6979..ab87cc58 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,4 +10,3 @@ *.json text eol=lf *.yml text eol=lf *.csv text eol=lf - diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml new file mode 100644 index 00000000..77633826 --- /dev/null +++ b/.github/workflows/build-test.yaml @@ -0,0 +1,20 @@ +name: Cargo Build & Test + +on: + push: + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 00000000..d64ed8e6 --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,13 @@ +name: pre-commit + +on: + pull_request: + push: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 diff --git a/.gitignore b/.gitignore index ae8e2558..56002ca3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,7 @@ Cargo.lock # Mac development .DS_Store + +# Emacs +*~ +\#* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..53ff6c56 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-added-large-files + - id: check-yaml + - id: check-toml + - 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: clippy