name: CI for Rust LDAP Client
on:
push:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
services:
ldap:
image: openidentityplatform/opendj
ports:
- 1389:1389
options: >
--env ROOT_USER_DN="cn=manager"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get LDAP container ID
id: ldap_container_id
run: echo "LDAP_CONTAINER_ID=$(docker ps --filter 'ancestor=openidentityplatform/opendj:latest' -q)" >> $GITHUB_ENV
- name: Copy LDIF to LDAP container
run: docker cp ./data/data.ldif ${{ env.LDAP_CONTAINER_ID }}:/tmp/data.ldif
- name: Import LDIF into OpenDJ
run: |
docker exec ${{ job.services.ldap.id }} \
/opt/opendj/bin/ldapmodify -h localhost -p 1389 -D "cn=manager" -w password -a -f /tmp/data.ldif
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Build
run: cargo build --verbose
- name: Install llvm-tools and cargo-llvm-cov
run: |
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov
- name: Run coverage
run: |
cargo llvm-cov --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: lcov.info
flags: unittests
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}