From 43c0549f91d0e086446d34aeda471e1cefda9a1a Mon Sep 17 00:00:00 2001 From: LDprg <71488985+LDprg@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:00:23 +0200 Subject: [PATCH 1/6] Create rust.yml action --- .github/workflows/rust.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..1b288a7 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,22 @@ +name: Rust + +on: + push: + branches: [ "rewrite" ] + pull_request: + branches: [ "rewrite" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose From 345a83d739938bdc8cab57384c4271ef0c3cf1ed Mon Sep 17 00:00:00 2001 From: LDprg <71488985+LDprg@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:02:05 +0200 Subject: [PATCH 2/6] Create rust-clippy.yml action --- .github/workflows/rust-clippy.yml | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/rust-clippy.yml diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml new file mode 100644 index 0000000..b2b7cd8 --- /dev/null +++ b/.github/workflows/rust-clippy.yml @@ -0,0 +1,55 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# rust-clippy is a tool that runs a bunch of lints to catch common +# mistakes in your Rust code and help improve your Rust code. +# More details at https://github.com/rust-lang/rust-clippy +# and https://rust-lang.github.io/rust-clippy/ + +name: rust-clippy analyze + +on: + push: + branches: [ "rewrite", "*" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "rewrite" ] + schedule: + - cron: '23 2 * * 5' + +jobs: + rust-clippy-analyze: + name: Run rust-clippy analyzing + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 + with: + profile: minimal + toolchain: stable + components: clippy + override: true + + - name: Install required cargo + run: cargo install clippy-sarif sarif-fmt + + - name: Run rust-clippy + run: + cargo clippy + --all-features + --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: rust-clippy-results.sarif + wait-for-processing: true From 2b7da12730e5c715a464542fd4688aa1fa6631f2 Mon Sep 17 00:00:00 2001 From: LDprg <71488985+LDprg@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:04:28 +0200 Subject: [PATCH 3/6] Add status bage --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c6d04a2..87e3ee5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # winapps rewrite -The winapps rewrite project is a whole rewrite of the legacy winapps in rust. Its goal is to simplify the installation and provide a cleaner codebase. \ No newline at end of file +[![Rust](https://github.com/winapps-org/winapps/actions/workflows/rust.yml/badge.svg?branch=rewrite)](https://github.com/winapps-org/winapps/actions/workflows/rust.yml) + +The winapps rewrite project is a whole rewrite of the legacy winapps in rust. Its goal is to simplify the installation and provide a cleaner codebase. From 6bea8e9435d38de45d9c390ad0268f0a83bb92e5 Mon Sep 17 00:00:00 2001 From: LDprg <71488985+LDprg@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:06:41 +0200 Subject: [PATCH 4/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 87e3ee5..a5c8847 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # winapps rewrite [![Rust](https://github.com/winapps-org/winapps/actions/workflows/rust.yml/badge.svg?branch=rewrite)](https://github.com/winapps-org/winapps/actions/workflows/rust.yml) +[![Rust Clippy](https://github.com/winapps-org/winapps/actions/workflows/rust-clippy.yml/badge.svg?branch=rewrite)](https://github.com/winapps-org/winapps/actions/workflows/rust-clippy.yml) The winapps rewrite project is a whole rewrite of the legacy winapps in rust. Its goal is to simplify the installation and provide a cleaner codebase. From c1949b0bccf88572718b1dd17c8a54b7b0f39807 Mon Sep 17 00:00:00 2001 From: LDprg <71488985+LDprg@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:08:54 +0200 Subject: [PATCH 5/6] Update rust-clippy.yml --- .github/workflows/rust-clippy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml index b2b7cd8..9cde16b 100644 --- a/.github/workflows/rust-clippy.yml +++ b/.github/workflows/rust-clippy.yml @@ -7,7 +7,7 @@ # More details at https://github.com/rust-lang/rust-clippy # and https://rust-lang.github.io/rust-clippy/ -name: rust-clippy analyze +name: Rust Clippy on: push: @@ -49,7 +49,7 @@ jobs: continue-on-error: true - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v2 with: sarif_file: rust-clippy-results.sarif wait-for-processing: true From a8b9a93048d96987e39e5c3ce6b207e1d9ba516d Mon Sep 17 00:00:00 2001 From: LDprg <71488985+LDprg@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:13:09 +0200 Subject: [PATCH 6/6] Update rust-clippy.yml --- .github/workflows/rust-clippy.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml index 9cde16b..1e6a866 100644 --- a/.github/workflows/rust-clippy.yml +++ b/.github/workflows/rust-clippy.yml @@ -22,21 +22,14 @@ jobs: rust-clippy-analyze: name: Run rust-clippy analyzing runs-on: ubuntu-latest + permissions: contents: read security-events: write - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + steps: - name: Checkout code - uses: actions/checkout@v2 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 - with: - profile: minimal - toolchain: stable - components: clippy - override: true + uses: actions/checkout@v3 - name: Install required cargo run: cargo install clippy-sarif sarif-fmt