Enable OIDC #545
Workflow file for this run
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: | |
| - master | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Allow writing from inside the container | |
| run: | | |
| chmod g+w,o+w . | |
| - name: Install Django | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install django>4.2 | |
| - name: Create env files for testing | |
| run: | | |
| python3 docker/manage-secrets.py | |
| - name: Build images | |
| run: | | |
| docker compose build | |
| - name: Start Compose Stack | |
| run: | | |
| docker compose -f compose.yaml -f compose.override.yml up -d | |
| - name: Run Tests | |
| run: | | |
| docker compose exec -it orthos2 bash -c 'coverage run --source="." manage.py test orthos2' | |
| docker compose exec -it orthos2 bash -c 'coverage report' | |
| docker compose exec -it orthos2 bash -c 'coverage xml' | |
| - name: Upload coverage | |
| uses: codacy/codacy-coverage-reporter-action@v1.3.0 | |
| with: | |
| project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
| coverage-reports: coverage.xml | |
| integration: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Django | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install django>4.2 | |
| - name: Create env files for testing | |
| run: | | |
| python3 docker/manage-secrets.py | |
| - name: Build Orthos 2 development docker images | |
| run: | | |
| docker compose build | |
| - name: Setup Orthos 2 server | |
| run: | | |
| docker compose -f compose.yaml -f compose.override.yml up -d | |
| - name: Generate Django Token | |
| run: | | |
| docker compose cp orthos2:/var/lib/orthos2/admin-token . | |
| echo "ORTHOS_DJANGO_ADMIN_TOKEN=$(cat ./admin-token)" >> $GITHUB_ENV | |
| - name: Configure orthosrc | |
| run: | | |
| sed -i "s/token = /token = $ORTHOS_DJANGO_ADMIN_TOKEN/g" cli/orthosrc | |
| sed -i "s/protocol = https/protocol = http/g" cli/orthosrc | |
| sed -i "s/server = orthos2.arch.suse.de/server = localhost/g" cli/orthosrc | |
| sed -i "s/port = 443/port = 8000/g" cli/orthosrc | |
| - run: cat cli/orthosrc | |
| - name: Execute Integration Tests | |
| run: | | |
| docker compose exec -it orthos2 bash -c 'cd cli; python3 -m unittest discover -v' |