Skip to content

Commit

Permalink
refactor github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
robatipoor committed Jan 25, 2024
1 parent b15e265 commit 26d865f
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -24,7 +24,7 @@ jobs:

- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-formater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/spell-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check spelling
uses: crate-ci/typos@master
6 changes: 3 additions & 3 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
APP_PROFILE: test
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -46,7 +46,7 @@ jobs:
override: true

- name: Cache tarpaulin
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-tarpaulin
with:
path: |
Expand All @@ -71,7 +71,7 @@ jobs:
./scripts/init_mockserver.sh
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Generate code coverage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ jobs:
APP_PROFILE: test
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
# build stage
FROM rust:latest as builder

WORKDIR /workspace

RUN apt-get update && apt-get install lld clang -y

COPY . .

RUN cargo build --release

# deploy stage
FROM debian:bullseye-slim

RUN apt-get update && apt-get install -y --no-install-recommends openssl ca-certificates && apt-get clean

# create workspace directory
WORKDIR /workspace

COPY static static

COPY settings settings

# copy binary and configuration files
COPY --from=builder /workspace/target/release/app .

# expose port
EXPOSE 8080

ENV APP_PROFILE prod

ENV RUST_LOG info

# run the binary
ENTRYPOINT ["./app"]
3 changes: 1 addition & 2 deletions src/util/claim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use axum_extra::{
TypedHeader,
};

use async_trait::async_trait;
use axum::extract::FromRequestParts;
use axum::http::request::Parts;
use axum::RequestPartsExt;
Expand Down Expand Up @@ -64,7 +63,7 @@ impl UserClaims {
}
}

#[async_trait]
#[async_trait::async_trait]
impl FromRequestParts<AppState> for UserClaims {
type Rejection = AppError;

Expand Down

0 comments on commit 26d865f

Please sign in to comment.