From d684298a0b95dfe1058acc7e0eac07cbacb4ca42 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 24 Feb 2022 14:21:01 +0100 Subject: [PATCH 1/4] Create a new cargo project --- Cargo.lock | 7 +++++++ Cargo.toml | 9 +++++++++ src/main.rs | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/main.rs diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..54d00349 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "dora-rs" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..65450b6d --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "dora-rs" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[workspace] + diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 00000000..47ad8c63 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello World!"); +} From 275a3bbcea9a5295244b1bfba6ecc1455bad0b6c Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 24 Feb 2022 14:21:29 +0100 Subject: [PATCH 2/4] We want to track the Cargo.lock in git --- .gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitignore b/.gitignore index 088ba6ba..f2e972dd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,5 @@ # will have compiled files and executables /target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - # These are backup files generated by rustfmt **/*.rs.bk From b9a05210ad64b71e3e22ae5418120d8cd381be60 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 24 Feb 2022 14:26:07 +0100 Subject: [PATCH 3/4] Add a rustup override file --- rust-toolchain.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..73cb934d --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "stable" +components = ["rustfmt", "clippy"] From 16f230c4ee7ff7fa1988c21cea25e46403c88b0e Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 24 Feb 2022 14:26:28 +0100 Subject: [PATCH 4/4] Add a basic CI job to test our Rust code --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..e5eec895 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + test: + name: "Test" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: "Check" + run: cargo check + - name: "Build" + run: cargo build + - name: "Test" + run: cargo test + + clippy: + name: "Clippy" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: "Clippy" + run: cargo clippy + + rustfmt: + name: "Formatting" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: "rustfmt" + run: cargo fmt -- --check