Skip to content

Commit

Permalink
Custom repo-add impl (#34)
Browse files Browse the repository at this point in the history
* custom repo-add and repo-remove implementation to remove os dependency
* add action to test formatting, linting and tests
  • Loading branch information
Lukas-Heiligenbrunner authored Aug 2, 2024
1 parent 78732dd commit 52fdd0d
Show file tree
Hide file tree
Showing 16 changed files with 869 additions and 93 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches:
- '**'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update local toolchain
run: |
rustup update
rustup component add clippy
rustup install nightly
- name: Toolchain info
run: |
cargo --version --verbose
rustc --version
cargo clippy --version
- name: Lint
run: |
cd backend
cargo fmt -- --check
cargo clippy -- -D warnings
- name: Test
run: |
cd backend
cargo check
cargo test --all
cd src/pacman-repo-utils && cargo test --all
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ FROM quay.io/podman/stable

# Copy the built binary from the previous stage
COPY --from=builder /app/target/release/aurcache /usr/local/bin/aurcache

RUN dnf -y install pacman && dnf clean all
COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh /usr/local/bin/aurcache

# Set the entry point or default command to run your application
WORKDIR /app
CMD /entrypoint.sh
138 changes: 100 additions & 38 deletions backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ shiplift = "0.7.0"
bigdecimal = "0.4.5"
env_logger = "0.11.5"
log = "0.4.22"
pacman-repo-utils = {path = "./src/pacman-repo-utils"}

[[bin]]
name = "aurcache"
Expand Down
3 changes: 0 additions & 3 deletions backend/src/api/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ pub async fn package_update_endpoint(
#[openapi(tag = "Packages")]
#[delete("/package/<id>")]
pub async fn package_del(db: &State<DatabaseConnection>, id: i32) -> Result<(), String> {
let db = db as &DatabaseConnection;

package_delete(db, id).await.map_err(|e| e.to_string())?;

Ok(())
}

Expand Down
Loading

0 comments on commit 52fdd0d

Please sign in to comment.