From 596096f7ddeecd5933e68f46f71a01cb4f17e512 Mon Sep 17 00:00:00 2001 From: Aayush Date: Mon, 15 Jul 2024 11:19:25 -0700 Subject: [PATCH 1/8] add in static-analysis checks as well as cargo check to ensure that the code compiles --- envoyfilter/.github/workflows/checks.yml | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 envoyfilter/.github/workflows/checks.yml diff --git a/envoyfilter/.github/workflows/checks.yml b/envoyfilter/.github/workflows/checks.yml new file mode 100644 index 00000000..45b49adb --- /dev/null +++ b/envoyfilter/.github/workflows/checks.yml @@ -0,0 +1,34 @@ +name: Static Analysis + +on: [push, pull_request] + +jobs: + # Check and Linting are seperate jobs because linting does not fail + #when there are errors outside of the changed files in the pr + check: + name: Check + runs-on: ubuntu-latest + steps: + - name: Setup | Checkout + uses: actions/checkout@v4 + - name: Run Check + run: cargo check --lib --bins --examples --all-features + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Setup | Checkout + uses: actions/checkout@v4 + - name: Run Clippy + run: cargo clippy --all-targets --all-features + + format: + name: Rustfmt + runs-on: ubuntu-latest + + steps: + - name: Setup | Checkout + uses: actions/checkout@v4 + - name: Run Rustfmt + run: cargo fmt --all -- --check \ No newline at end of file From 28c582fbdc5719dfc2233a7c549fd6085ed682fa Mon Sep 17 00:00:00 2001 From: Aayush Date: Mon, 15 Jul 2024 11:27:20 -0700 Subject: [PATCH 2/8] ensure to install rust --- envoyfilter/.github/workflows/checks.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/envoyfilter/.github/workflows/checks.yml b/envoyfilter/.github/workflows/checks.yml index 45b49adb..361ce090 100644 --- a/envoyfilter/.github/workflows/checks.yml +++ b/envoyfilter/.github/workflows/checks.yml @@ -11,6 +11,8 @@ jobs: steps: - name: Setup | Checkout uses: actions/checkout@v4 + - name: Setup | Rust + run: rustup toolchain install stable --profile minimal - name: Run Check run: cargo check --lib --bins --examples --all-features @@ -20,6 +22,8 @@ jobs: steps: - name: Setup | Checkout uses: actions/checkout@v4 + - name: Setup | Rust + run: rustup toolchain install stable --profile minimal - name: Run Clippy run: cargo clippy --all-targets --all-features @@ -30,5 +34,9 @@ jobs: steps: - name: Setup | Checkout uses: actions/checkout@v4 + - name: Setup | Rust + run: rustup toolchain install stable --profile minimal + - name: Setup | Install Rustfmt + run: rustup component add rustfmt - name: Run Rustfmt run: cargo fmt --all -- --check \ No newline at end of file From b7273eab55afb775586d19498bc133a619d3504c Mon Sep 17 00:00:00 2001 From: Aayush Date: Mon, 15 Jul 2024 11:29:56 -0700 Subject: [PATCH 3/8] move folder to correct spot and open correct directory in workflow --- {envoyfilter/.github => .github}/workflows/checks.yml | 3 +++ 1 file changed, 3 insertions(+) rename {envoyfilter/.github => .github}/workflows/checks.yml (90%) diff --git a/envoyfilter/.github/workflows/checks.yml b/.github/workflows/checks.yml similarity index 90% rename from envoyfilter/.github/workflows/checks.yml rename to .github/workflows/checks.yml index 361ce090..0efeb3e9 100644 --- a/envoyfilter/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -9,6 +9,7 @@ jobs: name: Check runs-on: ubuntu-latest steps: + - run: cd envoyfilter - name: Setup | Checkout uses: actions/checkout@v4 - name: Setup | Rust @@ -20,6 +21,7 @@ jobs: name: Lint runs-on: ubuntu-latest steps: + - run: cd envoyfilter - name: Setup | Checkout uses: actions/checkout@v4 - name: Setup | Rust @@ -32,6 +34,7 @@ jobs: runs-on: ubuntu-latest steps: + - run: cd envoyfilter - name: Setup | Checkout uses: actions/checkout@v4 - name: Setup | Rust From 5dc8acd8f145b51115feeaf1e3e49bafd34dfd5f Mon Sep 17 00:00:00 2001 From: Aayush Date: Mon, 15 Jul 2024 11:31:56 -0700 Subject: [PATCH 4/8] open directory after checking out code --- .github/workflows/checks.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0efeb3e9..dadc7aec 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -9,9 +9,9 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - run: cd envoyfilter - name: Setup | Checkout uses: actions/checkout@v4 + - run: cd envoyfilter - name: Setup | Rust run: rustup toolchain install stable --profile minimal - name: Run Check @@ -21,9 +21,9 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - run: cd envoyfilter - name: Setup | Checkout uses: actions/checkout@v4 + - run: cd envoyfilter - name: Setup | Rust run: rustup toolchain install stable --profile minimal - name: Run Clippy @@ -34,9 +34,9 @@ jobs: runs-on: ubuntu-latest steps: - - run: cd envoyfilter - name: Setup | Checkout uses: actions/checkout@v4 + - run: cd envoyfilter - name: Setup | Rust run: rustup toolchain install stable --profile minimal - name: Setup | Install Rustfmt From b59588c68e1289c98a3091b93173b4f60fe481da Mon Sep 17 00:00:00 2001 From: Aayush Date: Mon, 15 Jul 2024 11:36:16 -0700 Subject: [PATCH 5/8] open the directory before running check --- .github/workflows/checks.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index dadc7aec..2c271e44 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,11 +11,10 @@ jobs: steps: - name: Setup | Checkout uses: actions/checkout@v4 - - run: cd envoyfilter - name: Setup | Rust run: rustup toolchain install stable --profile minimal - name: Run Check - run: cargo check --lib --bins --examples --all-features + run: cd envoyfilter && cargo check --lib --bins --examples --all-features lint: name: Lint @@ -23,11 +22,10 @@ jobs: steps: - name: Setup | Checkout uses: actions/checkout@v4 - - run: cd envoyfilter - name: Setup | Rust run: rustup toolchain install stable --profile minimal - name: Run Clippy - run: cargo clippy --all-targets --all-features + run: cd envoyfilter && cargo clippy --all-targets --all-features format: name: Rustfmt @@ -36,10 +34,7 @@ jobs: steps: - name: Setup | Checkout uses: actions/checkout@v4 - - run: cd envoyfilter - name: Setup | Rust - run: rustup toolchain install stable --profile minimal - - name: Setup | Install Rustfmt - run: rustup component add rustfmt + run: rustup toolchain install stable --profile minimal - name: Run Rustfmt - run: cargo fmt --all -- --check \ No newline at end of file + run: cd envoyfilter && cargo fmt --all -- --check \ No newline at end of file From 8993853efbc18f4ea68f21fa1adfb2b7b1466fd1 Mon Sep 17 00:00:00 2001 From: Aayush Date: Mon, 15 Jul 2024 11:42:06 -0700 Subject: [PATCH 6/8] remove check on push, just have check on pr --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2c271e44..f0111719 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,6 +1,6 @@ name: Static Analysis -on: [push, pull_request] +on: pull_request jobs: # Check and Linting are seperate jobs because linting does not fail From a5661d9f5234dcf67347d05643f9be0bd57be886 Mon Sep 17 00:00:00 2001 From: Aayush Date: Mon, 15 Jul 2024 11:49:04 -0700 Subject: [PATCH 7/8] update name for checks from Static Analsysis to Checks on PR --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f0111719..75de73e4 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,4 +1,4 @@ -name: Static Analysis +name: Checks on PR on: pull_request From f5d6cfbcc060f9b0a714b8289a1007c01de31a38 Mon Sep 17 00:00:00 2001 From: Aayush Date: Mon, 15 Jul 2024 14:43:13 -0700 Subject: [PATCH 8/8] ensure that linting check fails on warning as well as removing cargo check since it is included in clippy. Updated name back to static analysis due to removal of check. --- .github/workflows/checks.yml | 40 --------------------------- .github/workflows/static-analysis.yml | 27 ++++++++++++++++++ 2 files changed, 27 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/checks.yml create mode 100644 .github/workflows/static-analysis.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 75de73e4..00000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Checks on PR - -on: pull_request - -jobs: - # Check and Linting are seperate jobs because linting does not fail - #when there are errors outside of the changed files in the pr - check: - name: Check - runs-on: ubuntu-latest - steps: - - name: Setup | Checkout - uses: actions/checkout@v4 - - name: Setup | Rust - run: rustup toolchain install stable --profile minimal - - name: Run Check - run: cd envoyfilter && cargo check --lib --bins --examples --all-features - - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - name: Setup | Checkout - uses: actions/checkout@v4 - - name: Setup | Rust - run: rustup toolchain install stable --profile minimal - - name: Run Clippy - run: cd envoyfilter && cargo clippy --all-targets --all-features - - format: - name: Rustfmt - runs-on: ubuntu-latest - - steps: - - name: Setup | Checkout - uses: actions/checkout@v4 - - name: Setup | Rust - run: rustup toolchain install stable --profile minimal - - name: Run Rustfmt - run: cd envoyfilter && cargo fmt --all -- --check \ No newline at end of file diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 00000000..61be55e2 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,27 @@ +name: Static Analysis + +on: pull_request + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Setup | Checkout + uses: actions/checkout@v4 + - name: Setup | Rust + run: rustup toolchain install stable --profile minimal + - name: Run Clippy + run: cd envoyfilter && cargo clippy --all-targets --all-features -- -Dwarnings + + format: + name: Rustfmt + runs-on: ubuntu-latest + + steps: + - name: Setup | Checkout + uses: actions/checkout@v4 + - name: Setup | Rust + run: rustup toolchain install stable --profile minimal + - name: Run Rustfmt + run: cd envoyfilter && cargo fmt --all -- --check