Bump the pip group across 1 directory with 11 updates #635
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| push-docker-image-to-harbor: | |
| description: "Push Docker Image to Harbor" | |
| type: boolean | |
| default: false | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| permissions: | |
| contents: read | |
| jobs: | |
| linting: | |
| name: Linting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install python-ldap system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libsasl2-dev python3-dev libldap2-dev libssl-dev | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.13" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install .[code-analysis] | |
| python -m pip install -r requirements.txt | |
| - name: Run black | |
| run: black --check --line-length 120 ldap_jwt_auth test | |
| - name: Run pylint | |
| run: pylint ldap_jwt_auth test | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Create logging configuration file | |
| run: cp logging.example.ini logging.ini | |
| - name: Run unit tests | |
| run: | | |
| docker build --file Dockerfile --target test --tag ldap-jwt-auth:test . | |
| docker run \ | |
| --name ldap-jwt-auth \ | |
| --volume ./logging.ini:/app/logging.ini \ | |
| ldap-jwt-auth:test \ | |
| pytest --config-file test/pytest.ini --cov ldap_jwt_auth --cov-report xml test/unit -v | |
| docker cp ldap-jwt-auth:/app/coverage.xml coverage.xml | |
| - name: Upload coverage reports to Codecov | |
| if: success() | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| e2e-tests: | |
| needs: [unit-tests] | |
| name: End-to-End Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Create logging configuration file | |
| run: cp logging.example.ini logging.ini | |
| - name: Setup keycloak | |
| run: | | |
| docker compose up --detach keycloak | |
| - name: Run e2e tests | |
| run: | | |
| docker build --file Dockerfile --target test --tag ldap-jwt-auth:test . | |
| docker run \ | |
| --name ldap-jwt-auth \ | |
| --volume ./logging.ini:/app/logging.ini \ | |
| --add-host localhost:host-gateway \ | |
| ldap-jwt-auth:test \ | |
| pytest --config-file test/pytest.ini test/e2e -v | |
| - name: Output docker logs (keycloak) | |
| if: failure() | |
| run: docker logs keycloak | |
| docker: | |
| # This job triggers only if all the other jobs succeed. It builds the Docker image | |
| # and if run manually from Github Actions, it pushes to Harbor. | |
| needs: [linting, unit-tests, e2e-tests] | |
| name: Docker | |
| runs-on: ubuntu-latest | |
| env: | |
| PUSH_DOCKER_IMAGE_TO_HARBOR: ${{ inputs.push-docker-image-to-harbor != null && inputs.push-docker-image-to-harbor || 'false' }} | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 | |
| with: | |
| images: ${{ vars.HARBOR_URL }}/auth-api | |
| - name: Login to Harbor | |
| if: ${{ fromJSON(env.PUSH_DOCKER_IMAGE_TO_HARBOR) }} | |
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 | |
| with: | |
| registry: ${{ vars.HARBOR_URL }} | |
| username: ${{ secrets.HARBOR_USERNAME }} | |
| password: ${{ secrets.HARBOR_TOKEN }} | |
| - name: ${{ fromJSON(env.PUSH_DOCKER_IMAGE_TO_HARBOR) && 'Build and push Docker image to Harbor' || 'Build Docker image' }} | |
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 | |
| with: | |
| context: . | |
| push: ${{ fromJSON(env.PUSH_DOCKER_IMAGE_TO_HARBOR) }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| target: prod |