85 lines
2.5 KiB
YAML
85 lines
2.5 KiB
YAML
name: Docker Compose Action
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
linting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
- name: Install the latest version of uv
|
|
uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1
|
|
- name: Check format
|
|
run: |
|
|
uv run --frozen ruff format --diff
|
|
- name: Linting
|
|
run: |
|
|
uv run --frozen ruff check
|
|
|
|
|
|
integration-test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
submodules: 'true'
|
|
|
|
|
|
###### Required to build OIDC App ######
|
|
|
|
- name: Set up php 8.4
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: 8.4
|
|
coverage: none
|
|
|
|
- name: Install OIDC app composer dependencies
|
|
run: |
|
|
cd third_party/oidc
|
|
composer install --no-dev
|
|
|
|
###### Required to build OIDC App ######
|
|
|
|
|
|
- name: Run docker compose
|
|
uses: hoverkraft-tech/compose-action@3846bcd61da338e9eaaf83e7ed0234a12b099b72 # v2.4.1
|
|
with:
|
|
compose-file: "./docker-compose.yml"
|
|
up-flags: "--build"
|
|
|
|
- name: Install the latest version of uv
|
|
uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1
|
|
|
|
- name: Install Playwright dependencies
|
|
run: |
|
|
uv run playwright install chromium --with-deps
|
|
|
|
- name: Wait for service to be ready
|
|
run: |
|
|
echo "Waiting for service at http://localhost:8080/ocs/v2.php/apps/serverinfo/api/v1/info to return 401..."
|
|
max_attempts=60
|
|
attempt=0
|
|
until curl -o /dev/null -s -w "%{http_code}\n" http://localhost:8080/ocs/v2.php/apps/serverinfo/api/v1/info | grep -q "401"; do
|
|
attempt=$((attempt + 1))
|
|
if [ $attempt -ge $max_attempts ]; then
|
|
echo "Service did not become ready in time."
|
|
exit 1
|
|
fi
|
|
echo "Attempt $attempt/$max_attempts: Service not ready, sleeping for 5 seconds..."
|
|
sleep 5
|
|
done
|
|
echo "Service is ready (returned 401)."
|
|
|
|
# Add subsequent steps here, e.g., running tests
|
|
- name: Run tests
|
|
env:
|
|
NEXTCLOUD_HOST: "http://localhost:8080"
|
|
NEXTCLOUD_USERNAME: "admin"
|
|
NEXTCLOUD_PASSWORD: "admin"
|
|
run: |
|
|
uv run pytest -v --log-cli-level=INFO
|