Repository: dusk-network/bls12_381 (language: rust)

Issue:
Implement Standardized CI Workflow
#### Summary
We've recently introduced a set of reusable workflow files in our [.github](https://github.com/dusk-network/.github/tree/main/.github/workflows#readme) repository to standardize our CI/CD process for Rust projects. These new workflows use up-to-date, maintained actions and also introduce caching, leading to significant performance improvements in subsequent runs. This repo is a prime candidate to benefit from this new setup.

#### Possible solution design or implementation
To implement this, we'll need to replace our current workflow process with the new workflow format. This involves removing the current jobs and replacing them with calls to the reusable workflows. We need to carefully test and check that the new workflows actually execute as expected.

#### Additional context
Due to Rust being available by default on the target OS, a `rust-toolchain` file is enough to specify what Rust version/target is required for a given workflow.

To prevent conflicts with upstream, it is advisable to not let clippy warnings break the CI.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/dusk_ci.yml b/.github/workflows/dusk_ci.yml
index a7cd8afc..fdac3e2a 100644
--- a/.github/workflows/dusk_ci.yml
+++ b/.github/workflows/dusk_ci.yml
@@ -1,69 +1,31 @@
-on: [pull_request]
+on:
+  pull_request:
+  push:
+    branches:
+      - master
 
 name: Continuous integration
 
 jobs:
-  check:
-    name: Check
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
-        with:
-          profile: minimal
-      - uses: actions-rs/cargo@v1
-        with:
-          command: check
+  code_analysis:
+    name: Code Analysis
+    uses: dusk-network/.github/.github/workflows/code-analysis.yml@main
+    with:
+      clippy_default: false
+      clippy_args: '-- -A clippy::derive_hash_xor_eq'
 
-  test_nightly:
-      name: Nightly tests std
-      runs-on: ubuntu-latest
-      steps:
-        - uses: actions/checkout@v2
-        - uses: actions-rs/toolchain@v1
-          with:
-            profile: minimal
-        - uses: actions-rs/cargo@v1
-          with:
-            command: test
-            args: --release
+  test_nightly_std:
+    name: Nightly tests std
+    uses: dusk-network/.github/.github/workflows/run-tests.yml@main
 
   test_nightly_no_std:
-      name: Nightly tests no_std
-      runs-on: ubuntu-latest
-      steps:
-        - uses: actions/checkout@v2
-        - uses: actions-rs/toolchain@v1
-          with:
-            profile: minimal
-        - uses: actions-rs/cargo@v1
-          with:
-            command: test
-            args: --release --no-default-features
+    name: Nightly tests no_std
+    uses: dusk-network/.github/.github/workflows/run-tests.yml@main
+    with:
+      test_flags: --no-default-features
 
   test_nightly_serde:
-      name: Nightly tests serde
-      runs-on: ubuntu-latest
-      steps:
-        - uses: actions/checkout@v2
-        - uses: actions-rs/toolchain@v1
-          with:
-            profile: minimal
-        - uses: actions-rs/cargo@v1
-          with:
-            command: test
-            args: --release --features serde_req
-
-  fmt:
-    name: Rustfmt
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
-        with:
-          profile: minimal
-      - run: rustup component add rustfmt
-      - uses: actions-rs/cargo@v1
-        with:
-          command: fmt
-          args: --all -- --check
+    name: Nightly tests serde
+    uses: dusk-network/.github/.github/workflows/run-tests.yml@main
+    with:
+      test_flags: --features serde_req
diff --git a/rust-toolchain b/rust-toolchain
deleted file mode 100644
index 51a91a07..00000000
--- a/rust-toolchain
+++ /dev/null
@@ -1,1 +0,0 @@
-nightly-2022-08-08
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
new file mode 100644
index 00000000..8e275b74
--- /dev/null
+++ b/rust-toolchain.toml
@@ -0,0 +1,3 @@
+[toolchain]
+channel = "nightly"
+components = ["rustfmt", "clippy"]


Test patch: