Skip to content

Commit

Permalink
Merge pull request #12 from Jim-Hodapp-Coaching/introduce_basic_githu…
Browse files Browse the repository at this point in the history
…b_ci_config

Introduce build and test GitHub Actions CI config
  • Loading branch information
jhodapp committed Nov 10, 2023
2 parents 3e94fdb + c4146d2 commit 52c4b3e
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build & Tests (backend)

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build_test_run:
name: Build and test
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu

- name: Use cached dependencies
uses: Swatinem/rust-cache@v2
with:
key: "ubuntu-22.04-x86_64-unknown-linux-gnu"

- name: Install seaORM CLI
run: |
cargo install sea-orm-cli
- name: Build
run: cargo build --all-targets

- name: Test
run: cargo test

lint:
name: Lint
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use cached dependencies
uses: Swatinem/rust-cache@v2
with:
key: "ubuntu-22.04-x86_64-unknown-linux-gnu"

- name: Install clippy and rustfmt
run: |
rustup component add clippy
rustup component add rustfmt
- name: Run clippy
run: cargo clippy -- -Dwarnings

- name: Run fmt
run: cargo fmt --check
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build & Tests (backend)](https://github.com/Jim-Hodapp-Coaching/refactor-platform-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/Jim-Hodapp-Coaching/refactor-platform-rs/actions/workflows/ci.yml)

# Refactor Coaching Platform (Backend)

## Intro
Expand Down
4 changes: 2 additions & 2 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ pub struct AppState {
}

impl AppState {
pub fn new(config: Config) -> Self {
pub fn new(app_config: Config) -> Self {
Self {
database_connection: None,
config: config,
config: app_config,
}
}
}
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2023 Jim Hodapp & Caleb Bourg
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
Expand All @@ -14,15 +14,14 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//!
//! **Refactor Coaching Platform**
//!
//!
//! A Rust-based backend that provides a web API for various client applications
//! (e.g. a web frontend) that facilitate the coaching of software engineers.
//!
//! The platform itself is useful for professional independent coaches, informal
//! mentors and engineering leaders who work with individual software engineers
//! and/or teams by providing a single application that facilitates and enhances
//! your coaching practice.
//!

use service::{config::Config, AppState};

Expand Down

0 comments on commit 52c4b3e

Please sign in to comment.