From e2338e18ad0deac2ab66cfaab311510a0074f0eb Mon Sep 17 00:00:00 2001 From: AjithPanneerselvam Date: Wed, 15 May 2024 23:38:34 +0100 Subject: [PATCH 1/3] chore: Add CI checks --- .github/workflows/rust.yml | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 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..2f174a1 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,70 @@ +name: Rust + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: -D warnings + RUSTDOCFLAGS: -D warnings + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: taiki-e/install-action@cargo-hack + - name: build + run: cargo hack build --feature-powerset + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: test + run: cargo test --all-features + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: fmt + run: cargo fmt --check + doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: doc + run: cargo doc --all-features + minimal: + runs-on: ubuntu-latest + name: ubuntu / stable / minimal-versions + steps: + - uses: actions/checkout@v3 + - name: Install stable + uses: dtolnay/rust-toolchain@stable + - name: Install nightly for -Zminimal-versions + uses: dtolnay/rust-toolchain@nightly + - name: rustup default stable + run: rustup default stable + - name: cargo update -Zminimal-versions + run: cargo +nightly update -Zminimal-versions + - name: cargo check + run: cargo check --locked --all-features + msrv: + runs-on: ubuntu-latest + # we use a matrix here just because env can't be used in job names + # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability + strategy: + matrix: + msrv: [1.65.0] + name: ubuntu / ${{ matrix.msrv }} + steps: + - uses: actions/checkout@v3 + - name: Install ${{ matrix.msrv }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.msrv }} + - name: cargo +${{ matrix.msrv }} check + run: cargo check --all-features From 9fa8082155c2e515bc990efcb191776506769b57 Mon Sep 17 00:00:00 2001 From: AjithPanneerselvam Date: Thu, 16 May 2024 21:37:29 +0100 Subject: [PATCH 2/3] chore: fix lint failures --- tests/tests.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/tests.rs b/tests/tests.rs index 0c3af3b..ef0841d 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -19,7 +19,7 @@ fn patch_exists() { let working_dir = working_dir.path(); let patch_folder = "u9KdJGBDefkZz"; - let patch_folder_path = working_dir.join(&patch_folder); + let patch_folder_path = working_dir.join(patch_folder); fs::create_dir(&patch_folder_path).expect("failed to create patch folder"); @@ -63,16 +63,19 @@ edition = \"2021\" ) } +#[allow(dead_code)] struct Patch<'a> { name: &'a str, path: &'a str, } +#[allow(dead_code)] struct PatchSet<'a> { registry: &'a str, patches: &'a [Patch<'a>], } +#[allow(dead_code)] impl<'a> PatchSet<'a> { fn format_1(&self) -> String { todo!() From 8969f94bed6d138414cc5565e032c35c59cc0981 Mon Sep 17 00:00:00 2001 From: AjithPanneerselvam Date: Thu, 16 May 2024 21:41:19 +0100 Subject: [PATCH 3/3] chore: use rust version 1.78.0 --- .github/workflows/rust.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2f174a1..d537b8f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,9 +2,9 @@ name: Rust on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] env: CARGO_TERM_COLOR: always @@ -15,28 +15,28 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: taiki-e/install-action@cargo-hack - - name: build - run: cargo hack build --feature-powerset + - uses: actions/checkout@v3 + - uses: taiki-e/install-action@cargo-hack + - name: build + run: cargo hack build --feature-powerset test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: test - run: cargo test --all-features + - uses: actions/checkout@v3 + - name: test + run: cargo test --all-features fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: fmt - run: cargo fmt --check + - uses: actions/checkout@v3 + - name: fmt + run: cargo fmt --check doc: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: doc - run: cargo doc --all-features + - uses: actions/checkout@v3 + - name: doc + run: cargo doc --all-features minimal: runs-on: ubuntu-latest name: ubuntu / stable / minimal-versions @@ -58,7 +58,7 @@ jobs: # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability strategy: matrix: - msrv: [1.65.0] + msrv: [1.78.0] name: ubuntu / ${{ matrix.msrv }} steps: - uses: actions/checkout@v3