[meta] initialize repository

This commit is contained in:
wfrsk 2022-09-13 15:25:16 +02:00
commit e6ee2597ac
6 changed files with 54 additions and 0 deletions

19
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Tests
on: [ push, pull_request ]
env:
CARGO_ENV_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
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

7
Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "violetta"
version = "0.1.0"

8
Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "violetta"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

10
src/main.rs Normal file
View File

@ -0,0 +1,10 @@
mod test;
#[allow(dead_code)]
fn greet_user( user: &str ) -> String {
format!( "Hello, {user}!" )
}
fn main() {
println!("Hello, world!");
}

9
src/test.rs Normal file
View File

@ -0,0 +1,9 @@
#[cfg(test)]
mod test {
use crate::*;
#[test]
fn does_it_greet_us( ) {
assert_eq!( greet_user( "John" ), "Hello, John!" );
}
}