Skip to content

Commit

Permalink
Update ci actions
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreOucif committed Jul 8, 2023
1 parent 9f0c149 commit a4f63fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 47 deletions.
57 changes: 12 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ on:
- "*"
jobs:
format:
name: Check code formatting
name: Rust CI
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup cargo
uses: ./.github/actions/cargo-setup

- name: Setup clippy
run: rustup component add clippy

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -23,57 +29,18 @@ jobs:
- name: Check code formatting
run: cargo +nightly fmt -- --check

# - name: Check codecov.yml file format
# run: curl --data-binary @- https://codecov.io/validate < codecov.yml

check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup cargo
uses: ./.github/actions/cargo-setup

- name: Check application
uses: actions-rs/cargo@v1
with:
command: check

build:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup cargo
uses: ./.github/actions/cargo-setup
- name: Run clippy
run: cargo clippy

- name: Compile application
uses: actions-rs/cargo@v1
with:
command: build

lint:
name: Clippy checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup cargo
uses: ./.github/actions/cargo-setup

- name: Setup clippy
run: rustup component add clippy

- name: Annotate commit with clippy warnings
uses: actions-rs/clippy-check@v1
- name: Test application
uses: actions-rs/cargo@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --bins --tests --examples -- -D warnings
command: test

# unit_tests:
# name: Unit tests
Expand Down
4 changes: 2 additions & 2 deletions application/rest-api-adapter/src/api/user_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ mod tests {
"name": user_name
});
let user_stub = User::create_user_from_name(user_name.clone());
let user_id = user_stub.id.clone();
let user_id = user_stub.id;
let mock = UserFacadeMock { user: user_stub };
let rocket_builder = UserApi {}.build_api(rocket::build(), Arc::new(mock));

Expand Down Expand Up @@ -85,7 +85,7 @@ mod tests {
fn create_user(&self, name: String) -> Result<User, String> {
Ok(User {
name: name.to_string(),
id: self.user.id.clone(),
id: self.user.id,
})
}
}
Expand Down

0 comments on commit a4f63fa

Please sign in to comment.