refactor: let the tenant factory decide which tenants exist #130
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: tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - '*.*.*' | |
| pull_request: | |
| branches: | |
| - main | |
| - '*.*.*' | |
| env: | |
| UV_LOCKED: 1 | |
| UV_PYTHON_PREFERENCE: only-managed | |
| permissions: | |
| contents: read | |
| jobs: | |
| tests: | |
| name: py${{ matrix.python }} unit tests | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: | |
| - '3.14' | |
| - '3.13' | |
| - '3.12' | |
| - '3.11' | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 | |
| with: | |
| version: "0.12.13" | |
| python-version: ${{ matrix.python }} | |
| enable-cache: true | |
| - name: Run tests | |
| run: uv run pytest --showlocals | |
| minversions: | |
| name: minimum dependency versions | |
| runs-on: ubuntu-24.04 | |
| env: | |
| UV_RESOLUTION: lowest-direct | |
| UV_LOCKED: 0 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 | |
| with: | |
| version: "0.12.13" | |
| python-version: "3.11" | |
| enable-cache: true | |
| - name: Install minimum dependencies | |
| run: uv sync | |
| - name: Run tests | |
| run: uv run pytest --showlocals | |
| style: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 | |
| with: | |
| version: "0.12.13" | |
| python-version: "3.14" | |
| enable-cache: true | |
| - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
| container: | |
| name: container image | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Build image | |
| run: docker build --file Containerfile --tag scim2-server:ci . | |
| - name: Start container | |
| run: docker run --detach --name scim2-server --publish 8080:8080 scim2-server:ci --bearer-token secret | |
| - name: Check the server answers | |
| run: | | |
| curl --fail --silent --retry 30 --retry-delay 1 --retry-all-errors --output /dev/null http://127.0.0.1:8080/v2/ServiceProviderConfig | |
| test "$(curl --silent --output /dev/null --write-out '%{http_code}' http://127.0.0.1:8080/v2/Users)" = 401 | |
| curl --fail --silent --output /dev/null --header "Authorization: Bearer secret" http://127.0.0.1:8080/v2/Users | |
| - name: Stop container | |
| run: timeout 5 docker stop scim2-server | |
| - name: Show logs | |
| if: always() | |
| run: docker logs scim2-server | |
| all-checks: | |
| if: always() | |
| needs: [tests, minversions, style, container] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Fail if a needed job did not succeed | |
| if: >- | |
| contains(needs.*.result, 'failure') | |
| || contains(needs.*.result, 'cancelled') | |
| || contains(needs.*.result, 'skipped') | |
| run: exit 1 |