From 8c82e8dc6dc0029920300b9d76daa6f4c14016ec Mon Sep 17 00:00:00 2001 From: Guido Espana Date: Tue, 23 Jul 2024 23:17:31 +0000 Subject: [PATCH 1/2] Preliminary test with pre-commit --- .gitattributes | 1 - .github/build-test.yaml | 20 ++++++++++++++++++++ .github/pre-commit.yaml | 13 +++++++++++++ .github/pre-commit.yaml~ | 14 ++++++++++++++ .gitignore | 4 ++++ .pre-commit-config.yaml | 15 +++++++++++++++ 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 .github/build-test.yaml create mode 100644 .github/pre-commit.yaml create mode 100644 .github/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/build-test.yaml b/.github/build-test.yaml new file mode 100644 index 00000000..958d97ed --- /dev/null +++ b/.github/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 \ No newline at end of file diff --git a/.github/pre-commit.yaml b/.github/pre-commit.yaml new file mode 100644 index 00000000..36f55de1 --- /dev/null +++ b/.github/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 \ No newline at end of file diff --git a/.github/pre-commit.yaml~ b/.github/pre-commit.yaml~ new file mode 100644 index 00000000..18e74986 --- /dev/null +++ b/.github/pre-commit.yaml~ @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index ae8e2558..08e68b9e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,7 @@ Cargo.lock # Mac development .DS_Store + +# Emacs +*~ +\#* \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..9c7d17d9 --- /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 \ No newline at end of file From 1bc0eb0210a1dd8f3e21422a28201422d24254f6 Mon Sep 17 00:00:00 2001 From: Guido Espana Date: Tue, 23 Jul 2024 23:29:44 +0000 Subject: [PATCH 2/2] adding tests to workflows directory --- .github/pre-commit.yaml~ | 14 -------------- .github/{ => workflows}/build-test.yaml | 2 +- .github/{ => workflows}/pre-commit.yaml | 4 ++-- .gitignore | 2 +- .pre-commit-config.yaml | 2 +- 5 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 .github/pre-commit.yaml~ rename .github/{ => workflows}/build-test.yaml (88%) rename .github/{ => workflows}/pre-commit.yaml (80%) diff --git a/.github/pre-commit.yaml~ b/.github/pre-commit.yaml~ deleted file mode 100644 index 18e74986..00000000 --- a/.github/pre-commit.yaml~ +++ /dev/null @@ -1,14 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: [main] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.1 \ No newline at end of file diff --git a/.github/build-test.yaml b/.github/workflows/build-test.yaml similarity index 88% rename from .github/build-test.yaml rename to .github/workflows/build-test.yaml index 958d97ed..77633826 100644 --- a/.github/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -17,4 +17,4 @@ jobs: - name: Build run: cargo build --verbose - name: Run tests - run: cargo test --verbose \ No newline at end of file + run: cargo test --verbose diff --git a/.github/pre-commit.yaml b/.github/workflows/pre-commit.yaml similarity index 80% rename from .github/pre-commit.yaml rename to .github/workflows/pre-commit.yaml index 36f55de1..d64ed8e6 100644 --- a/.github/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -1,6 +1,6 @@ name: pre-commit -on: +on: pull_request: push: @@ -10,4 +10,4 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.1 \ No newline at end of file + - uses: pre-commit/action@v3.0.1 diff --git a/.gitignore b/.gitignore index 08e68b9e..56002ca3 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,4 @@ Cargo.lock # Emacs *~ -\#* \ No newline at end of file +\#* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c7d17d9..53ff6c56 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,4 +12,4 @@ repos: rev: v1.0 hooks: - id: fmt - - id: clippy \ No newline at end of file + - id: clippy