diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..82f2160 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,34 @@ +name: Integration Test + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + integration: + services: + keycloak: + image: quay.io/keycloak/keycloak:24.0.2 + env: + KEYCLOAK_ADMIN: admin + KEYCLOAK_ADMIN_PASSWORD: password + ports: + - "8080:8080" + options: >- + --entrypoint start-dev + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.74.0 + - name: Build + run: cargo build --verbose + - name: Run unit tests + run: cargo test --verbose + - name: Run integration tests + run: cargo run --example=adduser diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index a5bfbdb..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Rust - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.74.0 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose diff --git a/examples/adduser.rs b/examples/adduser.rs index efc3f11..6d9d562 100644 --- a/examples/adduser.rs +++ b/examples/adduser.rs @@ -5,7 +5,7 @@ use keycloak::{ #[tokio::main] async fn main() -> Result<(), Box> { - let url = std::env::var("KEYCLOAK_ADDR").unwrap_or_else(|_| "http://localhost:9080".into()); + let url = std::env::var("KEYCLOAK_ADDR").unwrap_or_else(|_| "http://localhost:8080".into()); let user = std::env::var("KEYCLOAK_USER").unwrap_or_else(|_| "admin".into()); let password = std::env::var("KEYCLOAK_PASSWORD").unwrap_or_else(|_| "password".into()); let client = reqwest::Client::new();